3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
14 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
28 #define DL_IMPORT(t) t
31 #define DL_EXPORT(t) t
34 #ifndef HAVE_LONG_LONG
35 #if PY_VERSION_HEX >= 0x02070000
36 #define HAVE_LONG_LONG
40 #define PY_LONG_LONG LONG_LONG
43 #define Py_HUGE_VAL HUGE_VAL
46 #define CYTHON_COMPILING_IN_PYPY 1
47 #define CYTHON_COMPILING_IN_PYSTON 0
48 #define CYTHON_COMPILING_IN_CPYTHON 0
49 #undef CYTHON_USE_TYPE_SLOTS
50 #define CYTHON_USE_TYPE_SLOTS 0
51 #undef CYTHON_USE_PYTYPE_LOOKUP
52 #define CYTHON_USE_PYTYPE_LOOKUP 0
53 #if PY_VERSION_HEX < 0x03050000
54 #undef CYTHON_USE_ASYNC_SLOTS
55 #define CYTHON_USE_ASYNC_SLOTS 0
56 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57 #define CYTHON_USE_ASYNC_SLOTS 1
59 #undef CYTHON_USE_PYLIST_INTERNALS
60 #define CYTHON_USE_PYLIST_INTERNALS 0
61 #undef CYTHON_USE_UNICODE_INTERNALS
62 #define CYTHON_USE_UNICODE_INTERNALS 0
63 #undef CYTHON_USE_UNICODE_WRITER
64 #define CYTHON_USE_UNICODE_WRITER 0
65 #undef CYTHON_USE_PYLONG_INTERNALS
66 #define CYTHON_USE_PYLONG_INTERNALS 0
67 #undef CYTHON_AVOID_BORROWED_REFS
68 #define CYTHON_AVOID_BORROWED_REFS 1
69 #undef CYTHON_ASSUME_SAFE_MACROS
70 #define CYTHON_ASSUME_SAFE_MACROS 0
71 #undef CYTHON_UNPACK_METHODS
72 #define CYTHON_UNPACK_METHODS 0
73 #undef CYTHON_FAST_THREAD_STATE
74 #define CYTHON_FAST_THREAD_STATE 0
75 #undef CYTHON_FAST_PYCALL
76 #define CYTHON_FAST_PYCALL 0
77 #undef CYTHON_PEP489_MULTI_PHASE_INIT
78 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79 #undef CYTHON_USE_TP_FINALIZE
80 #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82 #define CYTHON_COMPILING_IN_PYPY 0
83 #define CYTHON_COMPILING_IN_PYSTON 1
84 #define CYTHON_COMPILING_IN_CPYTHON 0
85 #ifndef CYTHON_USE_TYPE_SLOTS
86 #define CYTHON_USE_TYPE_SLOTS 1
88 #undef CYTHON_USE_PYTYPE_LOOKUP
89 #define CYTHON_USE_PYTYPE_LOOKUP 0
90 #undef CYTHON_USE_ASYNC_SLOTS
91 #define CYTHON_USE_ASYNC_SLOTS 0
92 #undef CYTHON_USE_PYLIST_INTERNALS
93 #define CYTHON_USE_PYLIST_INTERNALS 0
94 #ifndef CYTHON_USE_UNICODE_INTERNALS
95 #define CYTHON_USE_UNICODE_INTERNALS 1
97 #undef CYTHON_USE_UNICODE_WRITER
98 #define CYTHON_USE_UNICODE_WRITER 0
99 #undef CYTHON_USE_PYLONG_INTERNALS
100 #define CYTHON_USE_PYLONG_INTERNALS 0
101 #ifndef CYTHON_AVOID_BORROWED_REFS
102 #define CYTHON_AVOID_BORROWED_REFS 0
104 #ifndef CYTHON_ASSUME_SAFE_MACROS
105 #define CYTHON_ASSUME_SAFE_MACROS 1
107 #ifndef CYTHON_UNPACK_METHODS
108 #define CYTHON_UNPACK_METHODS 1
110 #undef CYTHON_FAST_THREAD_STATE
111 #define CYTHON_FAST_THREAD_STATE 0
112 #undef CYTHON_FAST_PYCALL
113 #define CYTHON_FAST_PYCALL 0
114 #undef CYTHON_PEP489_MULTI_PHASE_INIT
115 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116 #undef CYTHON_USE_TP_FINALIZE
117 #define CYTHON_USE_TP_FINALIZE 0
119 #define CYTHON_COMPILING_IN_PYPY 0
120 #define CYTHON_COMPILING_IN_PYSTON 0
121 #define CYTHON_COMPILING_IN_CPYTHON 1
122 #ifndef CYTHON_USE_TYPE_SLOTS
123 #define CYTHON_USE_TYPE_SLOTS 1
125 #if PY_VERSION_HEX < 0x02070000
126 #undef CYTHON_USE_PYTYPE_LOOKUP
127 #define CYTHON_USE_PYTYPE_LOOKUP 0
128 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129 #define CYTHON_USE_PYTYPE_LOOKUP 1
131 #if PY_MAJOR_VERSION < 3
132 #undef CYTHON_USE_ASYNC_SLOTS
133 #define CYTHON_USE_ASYNC_SLOTS 0
134 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135 #define CYTHON_USE_ASYNC_SLOTS 1
137 #if PY_VERSION_HEX < 0x02070000
138 #undef CYTHON_USE_PYLONG_INTERNALS
139 #define CYTHON_USE_PYLONG_INTERNALS 0
140 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141 #define CYTHON_USE_PYLONG_INTERNALS 1
143 #ifndef CYTHON_USE_PYLIST_INTERNALS
144 #define CYTHON_USE_PYLIST_INTERNALS 1
146 #ifndef CYTHON_USE_UNICODE_INTERNALS
147 #define CYTHON_USE_UNICODE_INTERNALS 1
149 #if PY_VERSION_HEX < 0x030300F0
150 #undef CYTHON_USE_UNICODE_WRITER
151 #define CYTHON_USE_UNICODE_WRITER 0
152 #elif !defined(CYTHON_USE_UNICODE_WRITER)
153 #define CYTHON_USE_UNICODE_WRITER 1
155 #ifndef CYTHON_AVOID_BORROWED_REFS
156 #define CYTHON_AVOID_BORROWED_REFS 0
158 #ifndef CYTHON_ASSUME_SAFE_MACROS
159 #define CYTHON_ASSUME_SAFE_MACROS 1
161 #ifndef CYTHON_UNPACK_METHODS
162 #define CYTHON_UNPACK_METHODS 1
164 #ifndef CYTHON_FAST_THREAD_STATE
165 #define CYTHON_FAST_THREAD_STATE 1
167 #ifndef CYTHON_FAST_PYCALL
168 #define CYTHON_FAST_PYCALL 1
170 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
173 #ifndef CYTHON_USE_TP_FINALIZE
174 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
180 #if CYTHON_USE_PYLONG_INTERNALS
181 #include "longintrepr.h"
186 #ifndef __has_attribute
187 #define __has_attribute(x) 0
189 #ifndef __has_cpp_attribute
190 #define __has_cpp_attribute(x) 0
192 #ifndef CYTHON_RESTRICT
193 #if defined(__GNUC__)
194 #define CYTHON_RESTRICT __restrict__
195 #elif defined(_MSC_VER) && _MSC_VER >= 1400
196 #define CYTHON_RESTRICT __restrict
197 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198 #define CYTHON_RESTRICT restrict
200 #define CYTHON_RESTRICT
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
208 # define CYTHON_UNUSED
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
213 # define CYTHON_UNUSED
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
232 #ifndef _MSC_STDINT_H_
234 typedef unsigned char uint8_t;
235 typedef unsigned int uint32_t;
237 typedef unsigned __int8 uint8_t;
238 typedef unsigned __int32 uint32_t;
244 #ifndef CYTHON_FALLTHROUGH
245 #if defined(__cplusplus) && __cplusplus >= 201103L
246 #if __has_cpp_attribute(fallthrough)
247 #define CYTHON_FALLTHROUGH [[fallthrough]]
248 #elif __has_cpp_attribute(clang::fallthrough)
249 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250 #elif __has_cpp_attribute(gnu::fallthrough)
251 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
254 #ifndef CYTHON_FALLTHROUGH
255 #if __has_attribute(fallthrough)
256 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
258 #define CYTHON_FALLTHROUGH
261 #if defined(__clang__ ) && defined(__apple_build_version__)
262 #if __apple_build_version__ < 7000000
263 #undef CYTHON_FALLTHROUGH
264 #define CYTHON_FALLTHROUGH
269 #ifndef CYTHON_INLINE
270 #if defined(__clang__)
271 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272 #elif defined(__GNUC__)
273 #define CYTHON_INLINE __inline__
274 #elif defined(_MSC_VER)
275 #define CYTHON_INLINE __inline
276 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277 #define CYTHON_INLINE inline
279 #define CYTHON_INLINE
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284 #define Py_OptimizeFlag 0
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292 #define __Pyx_DefaultClassType PyClass_Type
294 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297 #define __Pyx_DefaultClassType PyType_Type
299 #ifndef Py_TPFLAGS_CHECKTYPES
300 #define Py_TPFLAGS_CHECKTYPES 0
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303 #define Py_TPFLAGS_HAVE_INDEX 0
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309 #define Py_TPFLAGS_HAVE_FINALIZE 0
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312 #ifndef METH_FASTCALL
313 #define METH_FASTCALL 0x80
315 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
316 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
317 Py_ssize_t nargs, PyObject *kwnames);
319 #define __Pyx_PyCFunctionFast _PyCFunctionFast
320 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
326 #define __Pyx_PyFastCFunction_Check(func) 0
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329 #define PyObject_Malloc(s) PyMem_Malloc(s)
330 #define PyObject_Free(p) PyMem_Free(p)
331 #define PyObject_Realloc(p) PyMem_Realloc(p)
333 #if CYTHON_COMPILING_IN_PYSTON
334 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
337 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341 #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345 #define __Pyx_PyThreadState_Current PyThreadState_GET()
347 #define __Pyx_PyThreadState_Current _PyThreadState_Current
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
354 *key = PyThread_create_key();
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
358 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
359 *key = Py_tss_NEEDS_INIT;
362 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
365 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
366 return *key != Py_tss_NEEDS_INIT;
368 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
369 PyThread_delete_key(*key);
370 *key = Py_tss_NEEDS_INIT;
372 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
373 return PyThread_set_key_value(*key, value);
375 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
376 return PyThread_get_key_value(*key);
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
388 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397 #define CYTHON_PEP393_ENABLED 1
398 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399 0 : _PyUnicode_Ready((PyObject *)(op)))
400 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
409 #define CYTHON_PEP393_ENABLED 0
410 #define PyUnicode_1BYTE_KIND 1
411 #define PyUnicode_2BYTE_KIND 2
412 #define PyUnicode_4BYTE_KIND 4
413 #define __Pyx_PyUnicode_READY(op) (0)
414 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
423 #if CYTHON_COMPILING_IN_PYPY
424 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
427 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
445 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448 #define PyObject_ASCII(o) PyObject_Repr(o)
450 #if PY_MAJOR_VERSION >= 3
451 #define PyBaseString_Type PyUnicode_Type
452 #define PyStringObject PyUnicodeObject
453 #define PyString_Type PyUnicode_Type
454 #define PyString_Check PyUnicode_Check
455 #define PyString_CheckExact PyUnicode_CheckExact
456 #define PyObject_Unicode PyObject_Str
458 #if PY_MAJOR_VERSION >= 3
459 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
462 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
465 #ifndef PySet_CheckExact
466 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
468 #if CYTHON_ASSUME_SAFE_MACROS
469 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
471 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
473 #if PY_MAJOR_VERSION >= 3
474 #define PyIntObject PyLongObject
475 #define PyInt_Type PyLong_Type
476 #define PyInt_Check(op) PyLong_Check(op)
477 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478 #define PyInt_FromString PyLong_FromString
479 #define PyInt_FromUnicode PyLong_FromUnicode
480 #define PyInt_FromLong PyLong_FromLong
481 #define PyInt_FromSize_t PyLong_FromSize_t
482 #define PyInt_FromSsize_t PyLong_FromSsize_t
483 #define PyInt_AsLong PyLong_AsLong
484 #define PyInt_AS_LONG PyLong_AS_LONG
485 #define PyInt_AsSsize_t PyLong_AsSsize_t
486 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488 #define PyNumber_Int PyNumber_Long
490 #if PY_MAJOR_VERSION >= 3
491 #define PyBoolObject PyLongObject
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494 #ifndef PyUnicode_InternFromString
495 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
498 #if PY_VERSION_HEX < 0x030200A4
499 typedef long Py_hash_t;
500 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
503 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
506 #if PY_MAJOR_VERSION >= 3
507 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
509 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
511 #if CYTHON_USE_ASYNC_SLOTS
512 #if PY_VERSION_HEX >= 0x030500B1
513 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
516 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
519 #define __Pyx_PyType_AsAsync(obj) NULL
521 #ifndef __Pyx_PyAsyncMethodsStruct
526 } __Pyx_PyAsyncMethodsStruct;
529 #if defined(WIN32) || defined(MS_WINDOWS)
530 #define _USE_MATH_DEFINES
534 #define __PYX_NAN() ((float) NAN)
536 static CYTHON_INLINE
float __PYX_NAN() {
538 memset(&value, 0xFF,
sizeof(value));
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
545 #define __Pyx_truncl truncl
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
551 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
554 #ifndef __PYX_EXTERN_C
556 #define __PYX_EXTERN_C extern "C"
558 #define __PYX_EXTERN_C extern
562 #define __PYX_HAVE__BoundaryConditions
563 #define __PYX_HAVE_API__BoundaryConditions
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
569 #include "pythread.h"
576 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
577 #define CYTHON_WITHOUT_ASSERTIONS
580 typedef struct {PyObject **p;
const char *
s;
const Py_ssize_t
n;
const char* encoding;
581 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
583 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
584 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
585 #define __PYX_DEFAULT_STRING_ENCODING ""
586 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
587 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
588 #define __Pyx_uchar_cast(c) ((unsigned char)c)
589 #define __Pyx_long_cast(x) ((long)x)
590 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
591 (sizeof(type) < sizeof(Py_ssize_t)) ||\
592 (sizeof(type) > sizeof(Py_ssize_t) &&\
593 likely(v < (type)PY_SSIZE_T_MAX ||\
594 v == (type)PY_SSIZE_T_MAX) &&\
595 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
596 v == (type)PY_SSIZE_T_MIN))) ||\
597 (sizeof(type) == sizeof(Py_ssize_t) &&\
598 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
599 v == (type)PY_SSIZE_T_MAX))) )
600 #if defined (__cplusplus) && __cplusplus >= 201103L
602 #define __Pyx_sst_abs(value) std::abs(value)
603 #elif SIZEOF_INT >= SIZEOF_SIZE_T
604 #define __Pyx_sst_abs(value) abs(value)
605 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
606 #define __Pyx_sst_abs(value) labs(value)
607 #elif defined (_MSC_VER)
608 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
609 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
610 #define __Pyx_sst_abs(value) llabs(value)
611 #elif defined (__GNUC__)
612 #define __Pyx_sst_abs(value) __builtin_llabs(value)
614 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
616 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
617 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
618 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
619 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
620 #define __Pyx_PyBytes_FromString PyBytes_FromString
621 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
622 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
623 #if PY_MAJOR_VERSION < 3
624 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
627 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
628 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
630 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
642 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
643 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
644 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
645 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
646 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *
u) {
647 const Py_UNICODE *u_end =
u;
649 return (
size_t)(u_end -
u - 1);
651 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
652 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
653 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
654 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
655 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
656 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
657 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
658 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
659 #define __Pyx_PySequence_Tuple(obj)\
660 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
662 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
663 #if CYTHON_ASSUME_SAFE_MACROS
664 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
666 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
668 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
669 #if PY_MAJOR_VERSION >= 3
670 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
672 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
674 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
675 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
676 static int __Pyx_sys_getdefaultencoding_not_ascii;
677 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
679 PyObject* default_encoding = NULL;
680 PyObject* ascii_chars_u = NULL;
681 PyObject* ascii_chars_b = NULL;
682 const char* default_encoding_c;
683 sys = PyImport_ImportModule(
"sys");
685 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
687 if (!default_encoding)
goto bad;
688 default_encoding_c = PyBytes_AsString(default_encoding);
689 if (!default_encoding_c)
goto bad;
690 if (strcmp(default_encoding_c,
"ascii") == 0) {
691 __Pyx_sys_getdefaultencoding_not_ascii = 0;
693 char ascii_chars[128];
695 for (
c = 0;
c < 128;
c++) {
698 __Pyx_sys_getdefaultencoding_not_ascii = 1;
699 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
700 if (!ascii_chars_u)
goto bad;
701 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
702 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
705 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
709 Py_DECREF(ascii_chars_u);
710 Py_DECREF(ascii_chars_b);
712 Py_DECREF(default_encoding);
715 Py_XDECREF(default_encoding);
716 Py_XDECREF(ascii_chars_u);
717 Py_XDECREF(ascii_chars_b);
721 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
722 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
724 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
725 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
726 static char* __PYX_DEFAULT_STRING_ENCODING;
727 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
729 PyObject* default_encoding = NULL;
730 char* default_encoding_c;
731 sys = PyImport_ImportModule(
"sys");
733 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
735 if (!default_encoding)
goto bad;
736 default_encoding_c = PyBytes_AsString(default_encoding);
737 if (!default_encoding_c)
goto bad;
738 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
739 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
740 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
741 Py_DECREF(default_encoding);
744 Py_XDECREF(default_encoding);
752 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
753 #define likely(x) __builtin_expect(!!(x), 1)
754 #define unlikely(x) __builtin_expect(!!(x), 0)
756 #define likely(x) (x)
757 #define unlikely(x) (x)
759 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
761 static PyObject *__pyx_m = NULL;
762 static PyObject *__pyx_d;
763 static PyObject *__pyx_b;
764 static PyObject *__pyx_cython_runtime = NULL;
765 static PyObject *__pyx_empty_tuple;
766 static PyObject *__pyx_empty_bytes;
767 static PyObject *__pyx_empty_unicode;
768 static int __pyx_lineno;
769 static int __pyx_clineno = 0;
770 static const char * __pyx_cfilenm= __FILE__;
771 static const char *__pyx_filename;
774 #if !defined(CYTHON_CCOMPLEX)
775 #if defined(__cplusplus)
776 #define CYTHON_CCOMPLEX 1
777 #elif defined(_Complex_I)
778 #define CYTHON_CCOMPLEX 1
780 #define CYTHON_CCOMPLEX 0
790 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
792 #define _Complex_I 1.0fj
796 static const char *__pyx_f[] = {
797 "proteus/BoundaryConditions.py",
799 "proteus/BoundaryConditions.pxd",
800 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
801 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
804 struct __pyx_memoryview_obj;
806 struct __pyx_memoryview_obj *memview;
809 Py_ssize_t strides[8];
810 Py_ssize_t suboffsets[8];
811 } __Pyx_memviewslice;
812 #define __Pyx_MemoryView_Len(m) (m.shape[0])
815 #include <pythread.h>
816 #ifndef CYTHON_ATOMICS
817 #define CYTHON_ATOMICS 1
819 #define __pyx_atomic_int_type int
820 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
821 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
823 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
824 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
825 #ifdef __PYX_DEBUG_ATOMICS
826 #warning "Using GNU atomics"
828 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
830 #undef __pyx_atomic_int_type
831 #define __pyx_atomic_int_type LONG
832 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
833 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
834 #ifdef __PYX_DEBUG_ATOMICS
835 #pragma message ("Using MSVC atomics")
837 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
838 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
839 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
840 #ifdef __PYX_DEBUG_ATOMICS
841 #warning "Using Intel atomics"
844 #undef CYTHON_ATOMICS
845 #define CYTHON_ATOMICS 0
846 #ifdef __PYX_DEBUG_ATOMICS
847 #warning "Not using atomics"
850 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
852 #define __pyx_add_acquisition_count(memview)\
853 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
854 #define __pyx_sub_acquisition_count(memview)\
855 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
857 #define __pyx_add_acquisition_count(memview)\
858 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
859 #define __pyx_sub_acquisition_count(memview)\
860 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
864 #ifndef __PYX_FORCE_INIT_THREADS
865 #define __PYX_FORCE_INIT_THREADS 0
869 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
870 #define __Pyx_PyGILState_Release PyGILState_Release
871 #define __Pyx_FastGIL_Remember()
872 #define __Pyx_FastGIL_Forget()
873 #define __Pyx_FastGilFuncInit()
876 #define IS_UNSIGNED(type) (((type) -1) > 0)
877 struct __Pyx_StructField_;
878 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
881 struct __Pyx_StructField_* fields;
889 typedef struct __Pyx_StructField_ {
890 __Pyx_TypeInfo* type;
895 __Pyx_StructField* field;
896 size_t parent_offset;
897 } __Pyx_BufFmt_StackElem;
899 __Pyx_StructField root;
900 __Pyx_BufFmt_StackElem* head;
902 size_t new_count, enc_count;
903 size_t struct_alignment;
909 } __Pyx_BufFmt_Context;
919 typedef npy_int8 __pyx_t_5numpy_int8_t;
928 typedef npy_int16 __pyx_t_5numpy_int16_t;
937 typedef npy_int32 __pyx_t_5numpy_int32_t;
946 typedef npy_int64 __pyx_t_5numpy_int64_t;
955 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
964 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
973 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
982 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
991 typedef npy_float32 __pyx_t_5numpy_float32_t;
1000 typedef npy_float64 __pyx_t_5numpy_float64_t;
1009 typedef npy_long __pyx_t_5numpy_int_t;
1018 typedef npy_longlong __pyx_t_5numpy_long_t;
1027 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1036 typedef npy_ulong __pyx_t_5numpy_uint_t;
1045 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1054 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1063 typedef npy_intp __pyx_t_5numpy_intp_t;
1072 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1081 typedef npy_double __pyx_t_5numpy_float_t;
1090 typedef npy_double __pyx_t_5numpy_double_t;
1099 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1103 typedef ::std::complex< float > __pyx_t_float_complex;
1105 typedef float _Complex __pyx_t_float_complex;
1108 typedef struct {
float real, imag; } __pyx_t_float_complex;
1110 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1115 typedef ::std::complex< double > __pyx_t_double_complex;
1117 typedef double _Complex __pyx_t_double_complex;
1120 typedef struct {
double real, imag; } __pyx_t_double_complex;
1122 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1126 struct __pyx_obj_18BoundaryConditions_BC_Base;
1127 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1128 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1129 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1130 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
1131 struct __pyx_array_obj;
1132 struct __pyx_MemviewEnum_obj;
1133 struct __pyx_memoryview_obj;
1134 struct __pyx_memoryviewslice_obj;
1143 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1152 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1161 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1170 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1179 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1188 struct __pyx_obj_18BoundaryConditions_BC_Base {
1190 __Pyx_memviewslice _b_or;
1206 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1208 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1209 __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1221 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1223 PyObject *__pyx_v_value;
1234 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1236 PyObject *__pyx_v_a;
1237 PyObject *__pyx_v_a0;
1248 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp {
1250 PyObject *__pyx_v_t1;
1251 PyObject *__pyx_v_value;
1262 struct __pyx_array_obj {
1264 struct __pyx_vtabstruct_array *__pyx_vtab;
1270 Py_ssize_t *_strides;
1271 Py_ssize_t itemsize;
1274 void (*callback_free_data)(
void *);
1276 int dtype_is_object;
1287 struct __pyx_MemviewEnum_obj {
1300 struct __pyx_memoryview_obj {
1302 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1305 PyObject *_array_interface;
1306 PyThread_type_lock lock;
1307 __pyx_atomic_int acquisition_count[2];
1308 __pyx_atomic_int *acquisition_count_aligned_p;
1311 int dtype_is_object;
1312 __Pyx_TypeInfo *typeinfo;
1323 struct __pyx_memoryviewslice_obj {
1324 struct __pyx_memoryview_obj __pyx_base;
1325 __Pyx_memviewslice from_slice;
1326 PyObject *from_object;
1327 PyObject *(*to_object_func)(
char *);
1328 int (*to_dtype_func)(
char *, PyObject *);
1341 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1342 void (*resetBC)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch);
1344 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1355 struct __pyx_vtabstruct_array {
1356 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1358 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1369 struct __pyx_vtabstruct_memoryview {
1370 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1371 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1372 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1373 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1374 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1375 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1376 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1378 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1389 struct __pyx_vtabstruct__memoryviewslice {
1390 struct __pyx_vtabstruct_memoryview __pyx_base;
1392 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1396 #ifndef CYTHON_REFNANNY
1397 #define CYTHON_REFNANNY 0
1401 void (*INCREF)(
void*, PyObject*, int);
1402 void (*DECREF)(
void*, PyObject*, int);
1403 void (*GOTREF)(
void*, PyObject*, int);
1404 void (*GIVEREF)(
void*, PyObject*, int);
1405 void* (*SetupContext)(
const char*, int,
const char*);
1406 void (*FinishContext)(
void**);
1407 } __Pyx_RefNannyAPIStruct;
1408 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1409 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1410 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1412 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1414 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1415 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1416 PyGILState_Release(__pyx_gilstate_save);\
1418 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1421 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1422 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1424 #define __Pyx_RefNannyFinishContext()\
1425 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1426 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1427 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1428 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1429 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1430 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1431 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1432 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1433 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1435 #define __Pyx_RefNannyDeclarations
1436 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1437 #define __Pyx_RefNannyFinishContext()
1438 #define __Pyx_INCREF(r) Py_INCREF(r)
1439 #define __Pyx_DECREF(r) Py_DECREF(r)
1440 #define __Pyx_GOTREF(r)
1441 #define __Pyx_GIVEREF(r)
1442 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1443 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1444 #define __Pyx_XGOTREF(r)
1445 #define __Pyx_XGIVEREF(r)
1447 #define __Pyx_XDECREF_SET(r, v) do {\
1448 PyObject *tmp = (PyObject *) r;\
1449 r = v; __Pyx_XDECREF(tmp);\
1451 #define __Pyx_DECREF_SET(r, v) do {\
1452 PyObject *tmp = (PyObject *) r;\
1453 r = v; __Pyx_DECREF(tmp);\
1455 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1456 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1459 #if CYTHON_USE_TYPE_SLOTS
1460 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1462 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1466 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1469 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1472 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1473 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1474 const char* function_name);
1477 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1478 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1481 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1482 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1483 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1484 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1485 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1486 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1487 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1488 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1489 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1490 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1491 int wraparound,
int boundscheck);
1492 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1493 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1494 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1495 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1496 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1497 int wraparound,
int boundscheck);
1498 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1499 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1500 int is_list,
int wraparound,
int boundscheck);
1503 #if CYTHON_USE_TYPE_SLOTS
1504 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1506 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1510 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1511 #define __Pyx_MEMVIEW_DIRECT 1
1512 #define __Pyx_MEMVIEW_PTR 2
1513 #define __Pyx_MEMVIEW_FULL 4
1514 #define __Pyx_MEMVIEW_CONTIG 8
1515 #define __Pyx_MEMVIEW_STRIDED 16
1516 #define __Pyx_MEMVIEW_FOLLOW 32
1517 #define __Pyx_IS_C_CONTIG 1
1518 #define __Pyx_IS_F_CONTIG 2
1519 static int __Pyx_init_memviewslice(
1520 struct __pyx_memoryview_obj *memview,
1522 __Pyx_memviewslice *memviewslice,
1523 int memview_is_new_reference);
1524 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1525 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1526 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1527 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1528 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1529 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1530 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1531 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1532 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1533 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1536 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1539 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1542 #if CYTHON_FAST_PYCCALL
1543 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1545 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1549 #if CYTHON_FAST_PYCALL
1550 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1551 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1552 #if 1 || PY_VERSION_HEX < 0x030600B1
1553 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs);
1555 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1560 #if CYTHON_COMPILING_IN_CPYTHON
1561 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1563 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1567 #if CYTHON_COMPILING_IN_CPYTHON
1568 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1572 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1575 #if CYTHON_COMPILING_IN_CPYTHON
1576 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1578 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1582 #if CYTHON_FAST_THREAD_STATE
1583 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1584 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1586 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1590 #if CYTHON_FAST_THREAD_STATE
1591 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1592 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1593 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1595 #define __Pyx_PyThreadState_declare
1596 #define __Pyx_PyThreadState_assign
1597 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1601 #if CYTHON_FAST_THREAD_STATE
1602 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1603 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1604 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1605 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1606 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1607 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1608 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1609 #if CYTHON_COMPILING_IN_CPYTHON
1610 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1612 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1615 #define __Pyx_PyErr_Clear() PyErr_Clear()
1616 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1617 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1618 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1619 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1620 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1621 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1622 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1626 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1629 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1632 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1635 static int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
1638 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1639 int lineno,
const char *filename,
1640 int full_traceback,
int nogil);
1643 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname);
1646 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1649 #define __Pyx_CyFunction_USED 1
1650 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1651 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1652 #define __Pyx_CYFUNCTION_CCLASS 0x04
1653 #define __Pyx_CyFunction_GetClosure(f)\
1654 (((__pyx_CyFunctionObject *) (f))->func_closure)
1655 #define __Pyx_CyFunction_GetClassObj(f)\
1656 (((__pyx_CyFunctionObject *) (f))->func_classobj)
1657 #define __Pyx_CyFunction_Defaults(type, f)\
1658 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1659 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1660 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1662 PyCFunctionObject func;
1663 #if PY_VERSION_HEX < 0x030500A0
1664 PyObject *func_weakreflist;
1666 PyObject *func_dict;
1667 PyObject *func_name;
1668 PyObject *func_qualname;
1670 PyObject *func_globals;
1671 PyObject *func_code;
1672 PyObject *func_closure;
1673 PyObject *func_classobj;
1675 int defaults_pyobjects;
1677 PyObject *defaults_tuple;
1678 PyObject *defaults_kwdict;
1679 PyObject *(*defaults_getter)(PyObject *);
1680 PyObject *func_annotations;
1681 } __pyx_CyFunctionObject;
1682 static PyTypeObject *__pyx_CyFunctionType = 0;
1683 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1684 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1685 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1686 int flags, PyObject* qualname,
1688 PyObject *module, PyObject *globals,
1690 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1693 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1695 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1697 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1699 static int __pyx_CyFunction_init(
void);
1702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1703 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1704 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1705 int has_cstart,
int has_cstop,
int wraparound);
1708 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1711 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
1714 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1715 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1716 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1717 (likely(PyDict_CheckExact(obj)) ?\
1718 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1720 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1721 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1725 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1728 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1731 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1734 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1737 #if CYTHON_FAST_THREAD_STATE
1738 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1739 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1740 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1741 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1743 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1744 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1748 #if CYTHON_FAST_THREAD_STATE
1749 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1750 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1752 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1756 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1757 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1758 __Pyx__ArgTypeTest(obj, type, name, exact))
1759 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1765 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1768 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1771 #if PY_MAJOR_VERSION >= 3
1772 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1774 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1778 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1781 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1782 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1784 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1785 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1787 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *
s, Py_ssize_t size,
const char *errors) {
1789 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1791 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *
s, Py_ssize_t size,
const char *errors) {
1793 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1795 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *
s, Py_ssize_t size,
const char *errors) {
1797 return PyUnicode_DecodeUTF16(
s, size, errors, &byteorder);
1801 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1802 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1803 const char* encoding,
const char* errors,
1804 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors));
1807 #if CYTHON_FAST_THREAD_STATE
1808 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1809 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1811 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1815 #if CYTHON_COMPILING_IN_CPYTHON
1816 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1817 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1818 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1819 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1821 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1822 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1823 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1825 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1827 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1829 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1830 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1831 PyListObject*
L = (PyListObject*) list;
1832 Py_ssize_t len = Py_SIZE(list);
1833 if (likely(
L->allocated > len)) {
1835 PyList_SET_ITEM(list, len, x);
1836 Py_SIZE(list) = len+1;
1839 return PyList_Append(list, x);
1842 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1846 #if !CYTHON_COMPILING_IN_PYPY
1847 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace);
1849 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1850 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1854 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject*
L, PyObject*
v) {
1855 #if CYTHON_COMPILING_IN_CPYTHON
1856 PyObject* none = _PyList_Extend((PyListObject*)
L,
v);
1857 if (unlikely(!none))
1862 return PyList_SetSlice(
L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX,
v);
1867 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1868 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1869 PyListObject*
L = (PyListObject*) list;
1870 Py_ssize_t len = Py_SIZE(list);
1871 if (likely(
L->allocated > len) & likely(len > (
L->allocated >> 1))) {
1873 PyList_SET_ITEM(list, len, x);
1874 Py_SIZE(list) = len+1;
1877 return PyList_Append(list, x);
1880 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1884 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
1887 static CYTHON_INLINE
long __Pyx_div_long(
long,
long);
1890 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1891 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1893 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1897 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1898 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1900 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1904 static int __Pyx_setup_reduce(PyObject* type_obj);
1907 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
1910 #ifdef CYTHON_CLINE_IN_TRACEBACK
1911 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1913 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
1918 PyCodeObject* code_object;
1920 } __Pyx_CodeObjectCacheEntry;
1921 struct __Pyx_CodeObjectCache {
1924 __Pyx_CodeObjectCacheEntry* entries;
1926 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1927 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
1928 static PyCodeObject *__pyx_find_code_object(
int code_line);
1929 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
1932 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1933 int py_line,
const char *filename);
1935 #if PY_MAJOR_VERSION < 3
1936 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1937 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1939 #define __Pyx_GetBuffer PyObject_GetBuffer
1940 #define __Pyx_ReleaseBuffer PyBuffer_Release
1946 Py_ssize_t shape, strides, suboffsets;
1947 } __Pyx_Buf_DimInfo;
1953 __Pyx_Buffer *rcbuffer;
1955 __Pyx_Buf_DimInfo diminfo[8];
1956 } __Pyx_LocalBuf_ND;
1959 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
1962 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1963 __Pyx_memviewslice *slice2,
1964 int ndim,
size_t itemsize);
1967 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
1970 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp);
1971 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj);
1974 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
1977 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
1978 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1979 __Pyx_BufFmt_StackElem* stack,
1980 __Pyx_TypeInfo* type);
1983 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
1986 static int __Pyx_ValidateAndInit_memviewslice(
1991 __Pyx_TypeInfo *dtype,
1992 __Pyx_BufFmt_StackElem stack[],
1993 __Pyx_memviewslice *memviewslice,
1994 PyObject *original_obj);
1997 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2000 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2003 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2008 #define __Pyx_CREAL(z) ((z).real())
2009 #define __Pyx_CIMAG(z) ((z).imag())
2011 #define __Pyx_CREAL(z) (__real__(z))
2012 #define __Pyx_CIMAG(z) (__imag__(z))
2015 #define __Pyx_CREAL(z) ((z).real)
2016 #define __Pyx_CIMAG(z) ((z).imag)
2018 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2019 && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2020 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2021 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2023 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2024 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2029 #define __Pyx_c_eq_float(a, b) ((a)==(b))
2030 #define __Pyx_c_sum_float(a, b) ((a)+(b))
2031 #define __Pyx_c_diff_float(a, b) ((a)-(b))
2032 #define __Pyx_c_prod_float(a, b) ((a)*(b))
2033 #define __Pyx_c_quot_float(a, b) ((a)/(b))
2034 #define __Pyx_c_neg_float(a) (-(a))
2036 #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2037 #define __Pyx_c_conj_float(z) (::std::conj(z))
2039 #define __Pyx_c_abs_float(z) (::std::abs(z))
2040 #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2043 #define __Pyx_c_is_zero_float(z) ((z)==0)
2044 #define __Pyx_c_conj_float(z) (conjf(z))
2046 #define __Pyx_c_abs_float(z) (cabsf(z))
2047 #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2051 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2052 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2053 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2054 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2055 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2056 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2057 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2058 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2060 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex);
2061 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2067 #define __Pyx_c_eq_double(a, b) ((a)==(b))
2068 #define __Pyx_c_sum_double(a, b) ((a)+(b))
2069 #define __Pyx_c_diff_double(a, b) ((a)-(b))
2070 #define __Pyx_c_prod_double(a, b) ((a)*(b))
2071 #define __Pyx_c_quot_double(a, b) ((a)/(b))
2072 #define __Pyx_c_neg_double(a) (-(a))
2074 #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2075 #define __Pyx_c_conj_double(z) (::std::conj(z))
2077 #define __Pyx_c_abs_double(z) (::std::abs(z))
2078 #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2081 #define __Pyx_c_is_zero_double(z) ((z)==0)
2082 #define __Pyx_c_conj_double(z) (conj(z))
2084 #define __Pyx_c_abs_double(z) (cabs(z))
2085 #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2089 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2090 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2091 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2092 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2093 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2094 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2095 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2096 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2098 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex);
2099 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2104 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
2107 static __Pyx_memviewslice
2108 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2109 const char *mode,
int ndim,
2110 size_t sizeof_dtype,
int contig_flag,
2111 int dtype_is_object);
2114 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2117 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2120 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2123 static int __Pyx_check_binary_version(
void);
2126 #if !defined(__Pyx_PyIdentifier_FromString)
2127 #if PY_MAJOR_VERSION < 3
2128 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2130 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2135 static PyObject *__Pyx_ImportModule(
const char *name);
2138 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
2141 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2143 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch);
2144 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2145 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2146 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2147 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2148 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2149 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2150 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2151 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2152 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2153 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2168 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2181 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2182 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2183 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2184 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2185 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2186 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
2189 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2190 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2191 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2192 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2193 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
2194 static PyTypeObject *__pyx_array_type = 0;
2195 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2196 static PyTypeObject *__pyx_memoryview_type = 0;
2197 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2198 static PyObject *
generic = 0;
2199 static PyObject *strided = 0;
2200 static PyObject *indirect = 0;
2201 static PyObject *contiguous = 0;
2202 static PyObject *indirect_contiguous = 0;
2203 static int __pyx_memoryview_thread_locks_used;
2204 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2205 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *);
2206 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2207 static void *__pyx_align_pointer(
void *,
size_t);
2208 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2209 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2210 static PyObject *_unellipsify(PyObject *,
int);
2211 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2212 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2213 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2214 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2215 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2216 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2217 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2218 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2219 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2220 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2221 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2222 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2223 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2224 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2225 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2226 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2227 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2228 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2229 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2230 static int __pyx_memoryview_err(PyObject *,
char *);
2231 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2232 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2233 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2234 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2235 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2236 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2237 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2238 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2239 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2240 #define __Pyx_MODULE_NAME "BoundaryConditions"
2241 extern int __pyx_module_is_main_BoundaryConditions;
2242 int __pyx_module_is_main_BoundaryConditions = 0;
2245 static PyObject *__pyx_builtin_sum;
2246 static PyObject *__pyx_builtin_TypeError;
2247 static PyObject *__pyx_builtin_ValueError;
2248 static PyObject *__pyx_builtin_range;
2249 static PyObject *__pyx_builtin_RuntimeError;
2250 static PyObject *__pyx_builtin_ImportError;
2251 static PyObject *__pyx_builtin_MemoryError;
2252 static PyObject *__pyx_builtin_enumerate;
2253 static PyObject *__pyx_builtin_Ellipsis;
2254 static PyObject *__pyx_builtin_id;
2255 static PyObject *__pyx_builtin_IndexError;
2256 static const char __pyx_k_O[] =
"O";
2257 static const char __pyx_k_a[] =
"a";
2258 static const char __pyx_k_c[] =
"c";
2259 static const char __pyx_k_t[] =
"t";
2260 static const char __pyx_k_x[] =
"x";
2261 static const char __pyx_k_a0[] =
"a0";
2262 static const char __pyx_k_id[] =
"id";
2263 static const char __pyx_k_nd[] =
"nd";
2264 static const char __pyx_k_t1[] =
"t1";
2265 static const char __pyx_k_b_i[] =
"b_i";
2266 static const char __pyx_k_get[] =
"get";
2267 static const char __pyx_k_new[] =
"__new__";
2268 static const char __pyx_k_obj[] =
"obj";
2269 static const char __pyx_k_sum[] =
"sum";
2270 static const char __pyx_k_None[] =
"None";
2271 static const char __pyx_k_b_or[] =
"b_or";
2272 static const char __pyx_k_base[] =
"base";
2273 static const char __pyx_k_dict[] =
"__dict__";
2274 static const char __pyx_k_main[] =
"__main__";
2275 static const char __pyx_k_mode[] =
"mode";
2276 static const char __pyx_k_name[] =
"name";
2277 static const char __pyx_k_ndim[] =
"ndim";
2278 static const char __pyx_k_pack[] =
"pack";
2279 static const char __pyx_k_self[] =
"self";
2280 static const char __pyx_k_size[] =
"size";
2281 static const char __pyx_k_step[] =
"step";
2282 static const char __pyx_k_stop[] =
"stop";
2283 static const char __pyx_k_test[] =
"__test__";
2284 static const char __pyx_k_ASCII[] =
"ASCII";
2285 static const char __pyx_k_class[] =
"__class__";
2286 static const char __pyx_k_error[] =
"error";
2287 static const char __pyx_k_flags[] =
"flags";
2288 static const char __pyx_k_range[] =
"range";
2289 static const char __pyx_k_shape[] =
"shape";
2290 static const char __pyx_k_start[] =
"start";
2291 static const char __pyx_k_state[] =
"state";
2292 static const char __pyx_k_value[] =
"value";
2293 static const char __pyx_k_Domain[] =
"Domain";
2294 static const char __pyx_k_dict_2[] =
"_dict";
2295 static const char __pyx_k_encode[] =
"encode";
2296 static const char __pyx_k_format[] =
"format";
2297 static const char __pyx_k_import[] =
"__import__";
2298 static const char __pyx_k_name_2[] =
"__name__";
2299 static const char __pyx_k_pickle[] =
"pickle";
2300 static const char __pyx_k_reduce[] =
"__reduce__";
2301 static const char __pyx_k_struct[] =
"struct";
2302 static const char __pyx_k_unpack[] =
"unpack";
2303 static const char __pyx_k_update[] =
"update";
2304 static const char __pyx_k_Context[] =
"Context";
2305 static const char __pyx_k_context[] =
"context";
2306 static const char __pyx_k_fortran[] =
"fortran";
2307 static const char __pyx_k_memview[] =
"memview";
2308 static const char __pyx_k_proteus[] =
"proteus";
2309 static const char __pyx_k_resetBC[] =
"resetBC";
2310 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2311 static const char __pyx_k_getstate[] =
"__getstate__";
2312 static const char __pyx_k_itemsize[] =
"itemsize";
2313 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2314 static const char __pyx_k_setstate[] =
"__setstate__";
2315 static const char __pyx_k_TypeError[] =
"TypeError";
2316 static const char __pyx_k_enumerate[] =
"enumerate";
2317 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2318 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2319 static const char __pyx_k_IndexError[] =
"IndexError";
2320 static const char __pyx_k_ValueError[] =
"ValueError";
2321 static const char __pyx_k_getContext[] =
"getContext";
2322 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2323 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2324 static const char __pyx_k_ImportError[] =
"ImportError";
2325 static const char __pyx_k_MemoryError[] =
"MemoryError";
2326 static const char __pyx_k_PickleError[] =
"PickleError";
2327 static const char __pyx_k_init_cython[] =
"init_cython";
2328 static const char __pyx_k_setLinearBC[] =
"setLinearBC";
2329 static const char __pyx_k_RuntimeError[] =
"RuntimeError";
2330 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2331 static const char __pyx_k_stringsource[] =
"stringsource";
2332 static const char __pyx_k_use_setstate[] =
"use_setstate";
2333 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2334 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2335 static const char __pyx_k_setConstantBC[] =
"setConstantBC";
2336 static const char __pyx_k_setLinearRamp[] =
"setLinearRamp";
2337 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2338 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2339 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2340 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2341 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2342 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2343 static const char __pyx_k_BC_Base_getContext[] =
"BC_Base.getContext";
2344 static const char __pyx_k_BoundaryConditions[] =
"BoundaryConditions";
2345 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2346 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2347 static const char __pyx_k_pyx_unpickle_BC_Base[] =
"__pyx_unpickle_BC_Base";
2348 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2349 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2350 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2351 static const char __pyx_k_BC_Base___reduce_cython[] =
"BC_Base.__reduce_cython__";
2352 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2353 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2354 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2355 static const char __pyx_k_BC_Base___setstate_cython[] =
"BC_Base.__setstate_cython__";
2356 static const char __pyx_k_BoundaryCondition_resetBC[] =
"BoundaryCondition.resetBC";
2357 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2358 static const char __pyx_k_setLinearBC_locals_lambda[] =
"setLinearBC.<locals>.<lambda>";
2359 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2360 static const char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
2361 static const char __pyx_k_setConstantBC_locals_lambda[] =
"setConstantBC.<locals>.<lambda>";
2362 static const char __pyx_k_setLinearRamp_locals_lambda[] =
"setLinearRamp.<locals>.<lambda>";
2363 static const char __pyx_k_BoundaryCondition_init_cython[] =
"BoundaryCondition.init_cython";
2364 static const char __pyx_k_BoundaryCondition_setLinearBC[] =
"BoundaryCondition.setLinearBC";
2365 static const char __pyx_k_proteus_BoundaryConditions_py[] =
"proteus/BoundaryConditions.py";
2366 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2367 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2368 static const char __pyx_k_BoundaryCondition_setConstantBC[] =
"BoundaryCondition.setConstantBC";
2369 static const char __pyx_k_BoundaryCondition_setLinearRamp[] =
"BoundaryCondition.setLinearRamp";
2370 static const char __pyx_k_numpy_core_multiarray_failed_to[] =
"numpy.core.multiarray failed to import";
2371 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] =
"self.uuOfXT cannot be converted to a Python object for pickling";
2372 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
2373 static const char __pyx_k_BoundaryCondition___reduce_cytho[] =
"BoundaryCondition.__reduce_cython__";
2374 static const char __pyx_k_BoundaryCondition___setstate_cyt[] =
"BoundaryCondition.__setstate_cython__";
2375 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2376 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2377 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2378 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2379 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2380 static const char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
2381 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] =
"Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2382 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2383 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2384 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2385 static const char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
2386 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2387 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] =
"Shape or nd must be passed to BC";
2388 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2389 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2390 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
2391 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2392 static const char __pyx_k_numpy_core_umath_failed_to_impor[] =
"numpy.core.umath failed to import";
2393 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2394 static const char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
2395 static PyObject *__pyx_n_s_ASCII;
2396 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2397 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2398 static PyObject *__pyx_n_s_BC_Base_getContext;
2399 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2400 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2401 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2402 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2403 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2404 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2405 static PyObject *__pyx_n_s_BoundaryCondition_setLinearRamp;
2406 static PyObject *__pyx_n_s_BoundaryConditions;
2407 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2408 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2409 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2410 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2411 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2412 static PyObject *__pyx_n_s_Context;
2413 static PyObject *__pyx_n_s_Domain;
2414 static PyObject *__pyx_n_s_Ellipsis;
2415 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2416 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2417 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2418 static PyObject *__pyx_n_s_ImportError;
2419 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2420 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2421 static PyObject *__pyx_n_s_IndexError;
2422 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2423 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2424 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2425 static PyObject *__pyx_n_s_MemoryError;
2426 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2427 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2428 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2429 static PyObject *__pyx_n_s_None;
2430 static PyObject *__pyx_n_b_O;
2431 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2432 static PyObject *__pyx_n_s_PickleError;
2433 static PyObject *__pyx_n_s_RuntimeError;
2434 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2435 static PyObject *__pyx_n_s_TypeError;
2436 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2437 static PyObject *__pyx_n_s_ValueError;
2438 static PyObject *__pyx_n_s_View_MemoryView;
2439 static PyObject *__pyx_n_s_a;
2440 static PyObject *__pyx_n_s_a0;
2441 static PyObject *__pyx_n_s_allocate_buffer;
2442 static PyObject *__pyx_n_s_b_i;
2443 static PyObject *__pyx_n_s_b_or;
2444 static PyObject *__pyx_n_s_base;
2445 static PyObject *__pyx_n_s_c;
2446 static PyObject *__pyx_n_u_c;
2447 static PyObject *__pyx_n_s_class;
2448 static PyObject *__pyx_n_s_cline_in_traceback;
2449 static PyObject *__pyx_n_s_context;
2450 static PyObject *__pyx_kp_s_contiguous_and_direct;
2451 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2452 static PyObject *__pyx_n_s_dict;
2453 static PyObject *__pyx_n_s_dict_2;
2454 static PyObject *__pyx_n_s_dtype_is_object;
2455 static PyObject *__pyx_n_s_encode;
2456 static PyObject *__pyx_n_s_enumerate;
2457 static PyObject *__pyx_n_s_error;
2458 static PyObject *__pyx_n_s_flags;
2459 static PyObject *__pyx_n_s_format;
2460 static PyObject *__pyx_n_s_fortran;
2461 static PyObject *__pyx_n_u_fortran;
2462 static PyObject *__pyx_n_s_get;
2463 static PyObject *__pyx_n_s_getContext;
2464 static PyObject *__pyx_n_s_getstate;
2465 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2466 static PyObject *__pyx_n_s_id;
2467 static PyObject *__pyx_n_s_import;
2468 static PyObject *__pyx_n_s_init_cython;
2469 static PyObject *__pyx_n_s_itemsize;
2470 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2471 static PyObject *__pyx_n_s_main;
2472 static PyObject *__pyx_n_s_memview;
2473 static PyObject *__pyx_n_s_mode;
2474 static PyObject *__pyx_n_s_name;
2475 static PyObject *__pyx_n_s_name_2;
2476 static PyObject *__pyx_n_s_nd;
2477 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2478 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2479 static PyObject *__pyx_n_s_ndim;
2480 static PyObject *__pyx_n_s_new;
2481 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2482 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2483 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2484 static PyObject *__pyx_n_s_obj;
2485 static PyObject *__pyx_n_s_pack;
2486 static PyObject *__pyx_n_s_pickle;
2487 static PyObject *__pyx_n_s_proteus;
2488 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2489 static PyObject *__pyx_n_s_pyx_PickleError;
2490 static PyObject *__pyx_n_s_pyx_checksum;
2491 static PyObject *__pyx_n_s_pyx_getbuffer;
2492 static PyObject *__pyx_n_s_pyx_result;
2493 static PyObject *__pyx_n_s_pyx_state;
2494 static PyObject *__pyx_n_s_pyx_type;
2495 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2496 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2497 static PyObject *__pyx_n_s_pyx_vtable;
2498 static PyObject *__pyx_n_s_range;
2499 static PyObject *__pyx_n_s_reduce;
2500 static PyObject *__pyx_n_s_reduce_cython;
2501 static PyObject *__pyx_n_s_reduce_ex;
2502 static PyObject *__pyx_n_s_resetBC;
2503 static PyObject *__pyx_n_s_self;
2504 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2505 static PyObject *__pyx_n_s_setConstantBC;
2506 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2507 static PyObject *__pyx_n_s_setLinearBC;
2508 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2509 static PyObject *__pyx_n_s_setLinearRamp;
2510 static PyObject *__pyx_n_s_setLinearRamp_locals_lambda;
2511 static PyObject *__pyx_n_s_setstate;
2512 static PyObject *__pyx_n_s_setstate_cython;
2513 static PyObject *__pyx_n_s_shape;
2514 static PyObject *__pyx_n_s_size;
2515 static PyObject *__pyx_n_s_start;
2516 static PyObject *__pyx_n_s_state;
2517 static PyObject *__pyx_n_s_step;
2518 static PyObject *__pyx_n_s_stop;
2519 static PyObject *__pyx_kp_s_strided_and_direct;
2520 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2521 static PyObject *__pyx_kp_s_strided_and_indirect;
2522 static PyObject *__pyx_kp_s_stringsource;
2523 static PyObject *__pyx_n_s_struct;
2524 static PyObject *__pyx_n_s_sum;
2525 static PyObject *__pyx_n_s_t;
2526 static PyObject *__pyx_n_s_t1;
2527 static PyObject *__pyx_n_s_test;
2528 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2529 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2530 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2531 static PyObject *__pyx_n_s_unpack;
2532 static PyObject *__pyx_n_s_update;
2533 static PyObject *__pyx_n_s_use_setstate;
2534 static PyObject *__pyx_n_s_value;
2535 static PyObject *__pyx_n_s_x;
2536 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd);
2537 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context);
2538 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2539 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2540 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2541 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2542 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2543 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2544 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2545 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2546 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2547 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2548 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2549 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2550 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value);
2551 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2552 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self);
2553 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2554 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2555 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2556 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2557 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t);
2558 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2559 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t);
2560 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a);
2561 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t);
2562 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value);
2563 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2564 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value);
2565 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2566 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self);
2567 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2568 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2569 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2570 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
2571 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2572 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2573 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2574 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2575 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2576 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2577 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2578 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2579 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2580 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2581 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2582 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2583 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2584 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2585 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2586 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2587 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2588 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2589 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2590 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2591 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2592 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2593 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2594 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2595 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2596 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2597 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2598 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2599 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2600 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2601 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2602 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2603 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2604 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2605 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2606 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2607 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2608 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2609 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2610 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2611 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2612 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2613 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k);
2614 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k);
2615 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k);
2616 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k);
2617 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, PyObject *a, PyObject *k);
2618 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2619 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2620 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2621 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2622 static PyObject *__pyx_int_0;
2623 static PyObject *__pyx_int_1;
2624 static PyObject *__pyx_int_158231071;
2625 static PyObject *__pyx_int_184977713;
2626 static PyObject *__pyx_int_neg_1;
2627 static PyObject *__pyx_slice_;
2628 static PyObject *__pyx_slice__2;
2629 static PyObject *__pyx_tuple__3;
2630 static PyObject *__pyx_tuple__4;
2631 static PyObject *__pyx_tuple__5;
2632 static PyObject *__pyx_tuple__6;
2633 static PyObject *__pyx_tuple__7;
2634 static PyObject *__pyx_tuple__8;
2635 static PyObject *__pyx_tuple__9;
2636 static PyObject *__pyx_slice__29;
2637 static PyObject *__pyx_slice__30;
2638 static PyObject *__pyx_slice__31;
2639 static PyObject *__pyx_tuple__10;
2640 static PyObject *__pyx_tuple__11;
2641 static PyObject *__pyx_tuple__12;
2642 static PyObject *__pyx_tuple__13;
2643 static PyObject *__pyx_tuple__14;
2644 static PyObject *__pyx_tuple__15;
2645 static PyObject *__pyx_tuple__16;
2646 static PyObject *__pyx_tuple__17;
2647 static PyObject *__pyx_tuple__18;
2648 static PyObject *__pyx_tuple__19;
2649 static PyObject *__pyx_tuple__20;
2650 static PyObject *__pyx_tuple__21;
2651 static PyObject *__pyx_tuple__22;
2652 static PyObject *__pyx_tuple__23;
2653 static PyObject *__pyx_tuple__24;
2654 static PyObject *__pyx_tuple__25;
2655 static PyObject *__pyx_tuple__26;
2656 static PyObject *__pyx_tuple__27;
2657 static PyObject *__pyx_tuple__28;
2658 static PyObject *__pyx_tuple__32;
2659 static PyObject *__pyx_tuple__33;
2660 static PyObject *__pyx_tuple__34;
2661 static PyObject *__pyx_tuple__35;
2662 static PyObject *__pyx_tuple__37;
2663 static PyObject *__pyx_tuple__39;
2664 static PyObject *__pyx_tuple__41;
2665 static PyObject *__pyx_tuple__43;
2666 static PyObject *__pyx_tuple__45;
2667 static PyObject *__pyx_tuple__47;
2668 static PyObject *__pyx_tuple__49;
2669 static PyObject *__pyx_tuple__51;
2670 static PyObject *__pyx_tuple__53;
2671 static PyObject *__pyx_tuple__55;
2672 static PyObject *__pyx_tuple__57;
2673 static PyObject *__pyx_tuple__58;
2674 static PyObject *__pyx_tuple__59;
2675 static PyObject *__pyx_tuple__60;
2676 static PyObject *__pyx_tuple__61;
2677 static PyObject *__pyx_tuple__62;
2678 static PyObject *__pyx_codeobj__36;
2679 static PyObject *__pyx_codeobj__38;
2680 static PyObject *__pyx_codeobj__40;
2681 static PyObject *__pyx_codeobj__42;
2682 static PyObject *__pyx_codeobj__44;
2683 static PyObject *__pyx_codeobj__46;
2684 static PyObject *__pyx_codeobj__48;
2685 static PyObject *__pyx_codeobj__50;
2686 static PyObject *__pyx_codeobj__52;
2687 static PyObject *__pyx_codeobj__54;
2688 static PyObject *__pyx_codeobj__56;
2689 static PyObject *__pyx_codeobj__63;
2701 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2702 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2703 PyObject *__pyx_v_shape = 0;
2704 PyObject *__pyx_v_name = 0;
2705 PyObject *__pyx_v_b_or = 0;
2706 PyObject *__pyx_v_b_i = 0;
2707 PyObject *__pyx_v_nd = 0;
2709 __Pyx_RefNannyDeclarations
2710 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
2712 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
2713 PyObject* values[5] = {0,0,0,0,0};
2714 values[0] = ((PyObject *)Py_None);
2715 values[1] = ((PyObject *)Py_None);
2716 values[2] = ((PyObject *)Py_None);
2717 values[3] = ((PyObject *)__pyx_int_0);
2718 values[4] = ((PyObject *)Py_None);
2719 if (unlikely(__pyx_kwds)) {
2721 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2723 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2725 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2727 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2729 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2731 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2734 default:
goto __pyx_L5_argtuple_error;
2736 kw_args = PyDict_Size(__pyx_kwds);
2740 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
2741 if (value) { values[0] = value; kw_args--; }
2746 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
2747 if (value) { values[1] = value; kw_args--; }
2752 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
2753 if (value) { values[2] = value; kw_args--; }
2758 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
2759 if (value) { values[3] = value; kw_args--; }
2764 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
2765 if (value) { values[4] = value; kw_args--; }
2768 if (unlikely(kw_args > 0)) {
2769 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
2772 switch (PyTuple_GET_SIZE(__pyx_args)) {
2773 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2775 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2777 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2779 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2781 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2784 default:
goto __pyx_L5_argtuple_error;
2787 __pyx_v_shape = values[0];
2788 __pyx_v_name = values[1];
2789 __pyx_v_b_or = values[2];
2790 __pyx_v_b_i = values[3];
2791 __pyx_v_nd = values[4];
2793 goto __pyx_L4_argument_unpacking_done;
2794 __pyx_L5_argtuple_error:;
2795 __Pyx_RaiseArgtupleInvalid(
"__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
2797 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2798 __Pyx_RefNannyFinishContext();
2800 __pyx_L4_argument_unpacking_done:;
2801 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
2804 __Pyx_RefNannyFinishContext();
2808 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
2810 __Pyx_RefNannyDeclarations
2811 PyObject *__pyx_t_1 = NULL;
2814 PyObject *__pyx_t_4 = NULL;
2816 __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
2817 __Pyx_RefNannySetupContext(
"__init__", 0);
2826 __Pyx_INCREF(__pyx_v_shape);
2827 __Pyx_GIVEREF(__pyx_v_shape);
2828 __Pyx_GOTREF(__pyx_v_self->Shape);
2829 __Pyx_DECREF(__pyx_v_self->Shape);
2830 __pyx_v_self->Shape = __pyx_v_shape;
2839 if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
2840 __pyx_t_1 = __pyx_v_name;
2841 __Pyx_INCREF(__pyx_t_1);
2842 __Pyx_GIVEREF(__pyx_t_1);
2843 __Pyx_GOTREF(__pyx_v_self->name);
2844 __Pyx_DECREF(__pyx_v_self->name);
2845 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
2855 __Pyx_INCREF(__pyx_n_s_None);
2856 __Pyx_GIVEREF(__pyx_n_s_None);
2857 __Pyx_GOTREF(__pyx_v_self->BC_type);
2858 __Pyx_DECREF(__pyx_v_self->BC_type);
2859 __pyx_v_self->BC_type = __pyx_n_s_None;
2868 __pyx_t_2 = (__pyx_v_shape != Py_None);
2869 __pyx_t_3 = (__pyx_t_2 != 0);
2879 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
2880 __Pyx_GOTREF(__pyx_t_1);
2881 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 18, __pyx_L1_error)
2882 __Pyx_GOTREF(__pyx_t_4);
2883 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2884 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L1_error)
2885 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2886 __pyx_v_self->nd = __pyx_t_5;
2905 __pyx_t_3 = (__pyx_v_nd != Py_None);
2906 __pyx_t_2 = (__pyx_t_3 != 0);
2916 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L1_error)
2917 __pyx_v_self->nd = __pyx_t_5;
2937 #ifndef CYTHON_WITHOUT_ASSERTIONS
2938 if (unlikely(!Py_OptimizeFlag)) {
2939 __pyx_t_2 = (__pyx_v_nd != Py_None);
2940 if (unlikely(!(__pyx_t_2 != 0))) {
2941 PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
2942 __PYX_ERR(0, 22, __pyx_L1_error)
2956 __pyx_t_2 = (__pyx_v_b_or != Py_None);
2957 __pyx_t_3 = (__pyx_t_2 != 0);
2967 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 24, __pyx_L1_error)
2968 __Pyx_GOTREF(__pyx_t_4);
2969 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 24, __pyx_L1_error)
2970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2971 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2972 __pyx_v_self->_b_or = __pyx_t_6;
2973 __pyx_t_6.memview = NULL;
2974 __pyx_t_6.data = NULL;
2994 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 26, __pyx_L1_error)
2995 __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2996 __pyx_v_self->_b_or = __pyx_t_6;
2997 __pyx_t_6.memview = NULL;
2998 __pyx_t_6.data = NULL;
3014 __Pyx_XDECREF(__pyx_t_1);
3015 __Pyx_XDECREF(__pyx_t_4);
3016 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
3017 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3020 __Pyx_RefNannyFinishContext();
3033 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3034 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] =
"\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
3035 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {
"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
3036 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3037 PyObject *__pyx_v_context = 0;
3038 PyObject *__pyx_r = 0;
3039 __Pyx_RefNannyDeclarations
3040 __Pyx_RefNannySetupContext(
"getContext (wrapper)", 0);
3042 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3043 PyObject* values[1] = {0};
3044 values[0] = ((PyObject *)Py_None);
3045 if (unlikely(__pyx_kwds)) {
3047 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3049 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3052 default:
goto __pyx_L5_argtuple_error;
3054 kw_args = PyDict_Size(__pyx_kwds);
3058 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3059 if (value) { values[0] = value; kw_args--; }
3062 if (unlikely(kw_args > 0)) {
3063 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"getContext") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
3066 switch (PyTuple_GET_SIZE(__pyx_args)) {
3067 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3070 default:
goto __pyx_L5_argtuple_error;
3073 __pyx_v_context = values[0];
3075 goto __pyx_L4_argument_unpacking_done;
3076 __pyx_L5_argtuple_error:;
3077 __Pyx_RaiseArgtupleInvalid(
"getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 41, __pyx_L3_error)
3079 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3080 __Pyx_RefNannyFinishContext();
3082 __pyx_L4_argument_unpacking_done:;
3083 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3086 __Pyx_RefNannyFinishContext();
3090 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3091 PyObject *__pyx_v_Context = NULL;
3092 PyObject *__pyx_r = NULL;
3093 __Pyx_RefNannyDeclarations
3095 PyObject *__pyx_t_2 = NULL;
3096 PyObject *__pyx_t_3 = NULL;
3097 PyObject *__pyx_t_4 = NULL;
3098 __Pyx_RefNannySetupContext(
"getContext", 0);
3107 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 50, __pyx_L1_error)
3117 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
3118 __Pyx_GOTREF(__pyx_t_2);
3119 __Pyx_INCREF(__pyx_n_s_Context);
3120 __Pyx_GIVEREF(__pyx_n_s_Context);
3121 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3122 __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
3123 __Pyx_GOTREF(__pyx_t_3);
3124 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3125 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
3126 __Pyx_GOTREF(__pyx_t_2);
3127 __Pyx_INCREF(__pyx_t_2);
3128 __pyx_v_Context = __pyx_t_2;
3129 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3130 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3139 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
3140 __Pyx_GOTREF(__pyx_t_2);
3142 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3143 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3144 if (likely(__pyx_t_4)) {
3145 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
3146 __Pyx_INCREF(__pyx_t_4);
3147 __Pyx_INCREF(
function);
3148 __Pyx_DECREF_SET(__pyx_t_2,
function);
3152 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
3153 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3155 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
3157 __Pyx_GOTREF(__pyx_t_3);
3158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3159 __Pyx_GIVEREF(__pyx_t_3);
3160 __Pyx_GOTREF(__pyx_v_self->ct);
3161 __Pyx_DECREF(__pyx_v_self->ct);
3162 __pyx_v_self->ct = __pyx_t_3;
3183 __Pyx_INCREF(__pyx_v_context);
3184 __Pyx_GIVEREF(__pyx_v_context);
3185 __Pyx_GOTREF(__pyx_v_self->ct);
3186 __Pyx_DECREF(__pyx_v_self->ct);
3187 __pyx_v_self->ct = __pyx_v_context;
3200 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3203 __Pyx_XDECREF(__pyx_t_2);
3204 __Pyx_XDECREF(__pyx_t_3);
3205 __Pyx_XDECREF(__pyx_t_4);
3206 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3209 __Pyx_XDECREF(__pyx_v_Context);
3210 __Pyx_XGIVEREF(__pyx_r);
3211 __Pyx_RefNannyFinishContext();
3224 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self);
3225 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3226 PyObject *__pyx_r = 0;
3227 __Pyx_RefNannyDeclarations
3228 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3229 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3232 __Pyx_RefNannyFinishContext();
3236 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3237 PyObject *__pyx_r = NULL;
3238 __Pyx_RefNannyDeclarations
3239 PyObject *__pyx_t_1 = NULL;
3240 __Pyx_RefNannySetupContext(
"__get__", 0);
3241 __Pyx_XDECREF(__pyx_r);
3242 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3243 __Pyx_GOTREF(__pyx_t_1);
3244 __pyx_r = __pyx_t_1;
3250 __Pyx_XDECREF(__pyx_t_1);
3251 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3254 __Pyx_XGIVEREF(__pyx_r);
3255 __Pyx_RefNannyFinishContext();
3260 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3261 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3263 __Pyx_RefNannyDeclarations
3264 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3265 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3268 __Pyx_RefNannyFinishContext();
3272 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3274 __Pyx_RefNannyDeclarations
3276 __Pyx_RefNannySetupContext(
"__set__", 0);
3277 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value);
if (unlikely((__pyx_t_1 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3278 __pyx_v_self->nd = __pyx_t_1;
3284 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3287 __Pyx_RefNannyFinishContext();
3300 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self);
3301 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3302 PyObject *__pyx_r = 0;
3303 __Pyx_RefNannyDeclarations
3304 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3305 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3308 __Pyx_RefNannyFinishContext();
3312 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3313 PyObject *__pyx_r = NULL;
3314 __Pyx_RefNannyDeclarations
3315 __Pyx_RefNannySetupContext(
"__get__", 0);
3316 __Pyx_XDECREF(__pyx_r);
3317 __Pyx_INCREF(__pyx_v_self->Shape);
3318 __pyx_r = __pyx_v_self->Shape;
3323 __Pyx_XGIVEREF(__pyx_r);
3324 __Pyx_RefNannyFinishContext();
3329 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3330 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3332 __Pyx_RefNannyDeclarations
3333 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3334 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3337 __Pyx_RefNannyFinishContext();
3341 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3343 __Pyx_RefNannyDeclarations
3344 __Pyx_RefNannySetupContext(
"__set__", 0);
3345 __Pyx_INCREF(__pyx_v_value);
3346 __Pyx_GIVEREF(__pyx_v_value);
3347 __Pyx_GOTREF(__pyx_v_self->Shape);
3348 __Pyx_DECREF(__pyx_v_self->Shape);
3349 __pyx_v_self->Shape = __pyx_v_value;
3353 __Pyx_RefNannyFinishContext();
3358 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self);
3359 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3361 __Pyx_RefNannyDeclarations
3362 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3363 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3366 __Pyx_RefNannyFinishContext();
3370 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3372 __Pyx_RefNannyDeclarations
3373 __Pyx_RefNannySetupContext(
"__del__", 0);
3374 __Pyx_INCREF(Py_None);
3375 __Pyx_GIVEREF(Py_None);
3376 __Pyx_GOTREF(__pyx_v_self->Shape);
3377 __Pyx_DECREF(__pyx_v_self->Shape);
3378 __pyx_v_self->Shape = Py_None;
3382 __Pyx_RefNannyFinishContext();
3395 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self);
3396 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3397 PyObject *__pyx_r = 0;
3398 __Pyx_RefNannyDeclarations
3399 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3400 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3403 __Pyx_RefNannyFinishContext();
3407 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3408 PyObject *__pyx_r = NULL;
3409 __Pyx_RefNannyDeclarations
3410 __Pyx_RefNannySetupContext(
"__get__", 0);
3411 __Pyx_XDECREF(__pyx_r);
3412 __Pyx_INCREF(__pyx_v_self->name);
3413 __pyx_r = __pyx_v_self->name;
3418 __Pyx_XGIVEREF(__pyx_r);
3419 __Pyx_RefNannyFinishContext();
3424 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3425 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3427 __Pyx_RefNannyDeclarations
3428 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3429 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3432 __Pyx_RefNannyFinishContext();
3436 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3438 __Pyx_RefNannyDeclarations
3439 PyObject *__pyx_t_1 = NULL;
3440 __Pyx_RefNannySetupContext(
"__set__", 0);
3441 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3442 __pyx_t_1 = __pyx_v_value;
3443 __Pyx_INCREF(__pyx_t_1);
3444 __Pyx_GIVEREF(__pyx_t_1);
3445 __Pyx_GOTREF(__pyx_v_self->name);
3446 __Pyx_DECREF(__pyx_v_self->name);
3447 __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3454 __Pyx_XDECREF(__pyx_t_1);
3455 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3458 __Pyx_RefNannyFinishContext();
3463 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self);
3464 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3466 __Pyx_RefNannyDeclarations
3467 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3468 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3471 __Pyx_RefNannyFinishContext();
3475 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3477 __Pyx_RefNannyDeclarations
3478 __Pyx_RefNannySetupContext(
"__del__", 0);
3479 __Pyx_INCREF(Py_None);
3480 __Pyx_GIVEREF(Py_None);
3481 __Pyx_GOTREF(__pyx_v_self->name);
3482 __Pyx_DECREF(__pyx_v_self->name);
3483 __pyx_v_self->name = ((PyObject*)Py_None);
3487 __Pyx_RefNannyFinishContext();
3500 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self);
3501 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3502 PyObject *__pyx_r = 0;
3503 __Pyx_RefNannyDeclarations
3504 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3505 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3508 __Pyx_RefNannyFinishContext();
3512 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3513 PyObject *__pyx_r = NULL;
3514 __Pyx_RefNannyDeclarations
3515 __Pyx_RefNannySetupContext(
"__get__", 0);
3516 __Pyx_XDECREF(__pyx_r);
3517 __Pyx_INCREF(__pyx_v_self->BC_type);
3518 __pyx_r = __pyx_v_self->BC_type;
3523 __Pyx_XGIVEREF(__pyx_r);
3524 __Pyx_RefNannyFinishContext();
3529 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3530 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3532 __Pyx_RefNannyDeclarations
3533 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3534 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3537 __Pyx_RefNannyFinishContext();
3541 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3543 __Pyx_RefNannyDeclarations
3544 PyObject *__pyx_t_1 = NULL;
3545 __Pyx_RefNannySetupContext(
"__set__", 0);
3546 if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
3547 __pyx_t_1 = __pyx_v_value;
3548 __Pyx_INCREF(__pyx_t_1);
3549 __Pyx_GIVEREF(__pyx_t_1);
3550 __Pyx_GOTREF(__pyx_v_self->BC_type);
3551 __Pyx_DECREF(__pyx_v_self->BC_type);
3552 __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
3559 __Pyx_XDECREF(__pyx_t_1);
3560 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3563 __Pyx_RefNannyFinishContext();
3568 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self);
3569 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
3571 __Pyx_RefNannyDeclarations
3572 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3573 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3576 __Pyx_RefNannyFinishContext();
3580 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3582 __Pyx_RefNannyDeclarations
3583 __Pyx_RefNannySetupContext(
"__del__", 0);
3584 __Pyx_INCREF(Py_None);
3585 __Pyx_GIVEREF(Py_None);
3586 __Pyx_GOTREF(__pyx_v_self->BC_type);
3587 __Pyx_DECREF(__pyx_v_self->BC_type);
3588 __pyx_v_self->BC_type = ((PyObject*)Py_None);
3592 __Pyx_RefNannyFinishContext();
3605 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self);
3606 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
3607 PyObject *__pyx_r = 0;
3608 __Pyx_RefNannyDeclarations
3609 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
3610 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3613 __Pyx_RefNannyFinishContext();
3617 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3618 PyObject *__pyx_r = NULL;
3619 __Pyx_RefNannyDeclarations
3620 __Pyx_RefNannySetupContext(
"__get__", 0);
3621 __Pyx_XDECREF(__pyx_r);
3622 __Pyx_INCREF(__pyx_v_self->ct);
3623 __pyx_r = __pyx_v_self->ct;
3628 __Pyx_XGIVEREF(__pyx_r);
3629 __Pyx_RefNannyFinishContext();
3634 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
3635 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3637 __Pyx_RefNannyDeclarations
3638 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
3639 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3642 __Pyx_RefNannyFinishContext();
3646 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3648 __Pyx_RefNannyDeclarations
3649 __Pyx_RefNannySetupContext(
"__set__", 0);
3650 __Pyx_INCREF(__pyx_v_value);
3651 __Pyx_GIVEREF(__pyx_v_value);
3652 __Pyx_GOTREF(__pyx_v_self->ct);
3653 __Pyx_DECREF(__pyx_v_self->ct);
3654 __pyx_v_self->ct = __pyx_v_value;
3658 __Pyx_RefNannyFinishContext();
3663 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self);
3664 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
3666 __Pyx_RefNannyDeclarations
3667 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
3668 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3671 __Pyx_RefNannyFinishContext();
3675 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3677 __Pyx_RefNannyDeclarations
3678 __Pyx_RefNannySetupContext(
"__del__", 0);
3679 __Pyx_INCREF(Py_None);
3680 __Pyx_GIVEREF(Py_None);
3681 __Pyx_GOTREF(__pyx_v_self->ct);
3682 __Pyx_DECREF(__pyx_v_self->ct);
3683 __pyx_v_self->ct = Py_None;
3687 __Pyx_RefNannyFinishContext();
3698 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
3699 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0};
3700 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3701 PyObject *__pyx_r = 0;
3702 __Pyx_RefNannyDeclarations
3703 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
3704 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3707 __Pyx_RefNannyFinishContext();
3711 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3712 int __pyx_v_use_setstate;
3713 PyObject *__pyx_v_state = NULL;
3714 PyObject *__pyx_v__dict = NULL;
3715 PyObject *__pyx_r = NULL;
3716 __Pyx_RefNannyDeclarations
3717 PyObject *__pyx_t_1 = NULL;
3718 PyObject *__pyx_t_2 = NULL;
3719 PyObject *__pyx_t_3 = NULL;
3723 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
3732 if (unlikely(!__pyx_v_self->_b_or.memview)) {PyErr_SetString(PyExc_AttributeError,
"Memoryview is not initialized");__PYX_ERR(1, 3, __pyx_L1_error)}
3733 __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(
char *)) __pyx_memview_get_double, (int (*)(
char *, PyObject *)) __pyx_memview_set_double, 0);;
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
3734 __Pyx_GOTREF(__pyx_t_1);
3735 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
3736 __Pyx_GOTREF(__pyx_t_2);
3737 __pyx_t_3 = PyTuple_New(6);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
3738 __Pyx_GOTREF(__pyx_t_3);
3739 __Pyx_INCREF(__pyx_v_self->BC_type);
3740 __Pyx_GIVEREF(__pyx_v_self->BC_type);
3741 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
3742 __Pyx_INCREF(__pyx_v_self->Shape);
3743 __Pyx_GIVEREF(__pyx_v_self->Shape);
3744 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
3745 __Pyx_GIVEREF(__pyx_t_1);
3746 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
3747 __Pyx_INCREF(__pyx_v_self->ct);
3748 __Pyx_GIVEREF(__pyx_v_self->ct);
3749 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
3750 __Pyx_INCREF(__pyx_v_self->name);
3751 __Pyx_GIVEREF(__pyx_v_self->name);
3752 PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
3753 __Pyx_GIVEREF(__pyx_t_2);
3754 PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
3757 __pyx_v_state = ((PyObject*)__pyx_t_3);
3767 __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
3768 __Pyx_GOTREF(__pyx_t_3);
3769 __pyx_v__dict = __pyx_t_3;
3779 __pyx_t_4 = (__pyx_v__dict != Py_None);
3780 __pyx_t_5 = (__pyx_t_4 != 0);
3790 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
3791 __Pyx_GOTREF(__pyx_t_3);
3792 __Pyx_INCREF(__pyx_v__dict);
3793 __Pyx_GIVEREF(__pyx_v__dict);
3794 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
3795 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
3796 __Pyx_GOTREF(__pyx_t_2);
3797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3798 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
3808 __pyx_v_use_setstate = 1;
3828 __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
3829 __pyx_t_6 = (__pyx_t_4 != 0);
3832 __pyx_t_5 = __pyx_t_6;
3833 goto __pyx_L4_bool_binop_done;
3835 __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
3836 __pyx_t_4 = (__pyx_t_6 != 0);
3839 __pyx_t_5 = __pyx_t_4;
3840 goto __pyx_L4_bool_binop_done;
3842 __pyx_t_4 = (__pyx_v_self->ct != Py_None);
3843 __pyx_t_6 = (__pyx_t_4 != 0);
3846 __pyx_t_5 = __pyx_t_6;
3847 goto __pyx_L4_bool_binop_done;
3849 __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
3850 __pyx_t_4 = (__pyx_t_6 != 0);
3851 __pyx_t_5 = __pyx_t_4;
3852 __pyx_L4_bool_binop_done:;
3853 __pyx_v_use_setstate = __pyx_t_5;
3864 __pyx_t_5 = (__pyx_v_use_setstate != 0);
3874 __Pyx_XDECREF(__pyx_r);
3875 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error)
3876 __Pyx_GOTREF(__pyx_t_2);
3877 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 11, __pyx_L1_error)
3878 __Pyx_GOTREF(__pyx_t_3);
3879 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3880 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3881 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3882 __Pyx_INCREF(__pyx_int_158231071);
3883 __Pyx_GIVEREF(__pyx_int_158231071);
3884 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3885 __Pyx_INCREF(Py_None);
3886 __Pyx_GIVEREF(Py_None);
3887 PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
3888 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
3889 __Pyx_GOTREF(__pyx_t_1);
3890 __Pyx_GIVEREF(__pyx_t_2);
3891 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3892 __Pyx_GIVEREF(__pyx_t_3);
3893 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3894 __Pyx_INCREF(__pyx_v_state);
3895 __Pyx_GIVEREF(__pyx_v_state);
3896 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
3899 __pyx_r = __pyx_t_1;
3920 __Pyx_XDECREF(__pyx_r);
3921 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
3922 __Pyx_GOTREF(__pyx_t_1);
3923 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
3924 __Pyx_GOTREF(__pyx_t_3);
3925 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3926 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3927 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3928 __Pyx_INCREF(__pyx_int_158231071);
3929 __Pyx_GIVEREF(__pyx_int_158231071);
3930 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3931 __Pyx_INCREF(__pyx_v_state);
3932 __Pyx_GIVEREF(__pyx_v_state);
3933 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
3934 __pyx_t_2 = PyTuple_New(2);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
3935 __Pyx_GOTREF(__pyx_t_2);
3936 __Pyx_GIVEREF(__pyx_t_1);
3937 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3938 __Pyx_GIVEREF(__pyx_t_3);
3939 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3942 __pyx_r = __pyx_t_2;
3955 __Pyx_XDECREF(__pyx_t_1);
3956 __Pyx_XDECREF(__pyx_t_2);
3957 __Pyx_XDECREF(__pyx_t_3);
3958 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3961 __Pyx_XDECREF(__pyx_v_state);
3962 __Pyx_XDECREF(__pyx_v__dict);
3963 __Pyx_XGIVEREF(__pyx_r);
3964 __Pyx_RefNannyFinishContext();
3976 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
3977 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0};
3978 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3979 PyObject *__pyx_r = 0;
3980 __Pyx_RefNannyDeclarations
3981 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
3982 __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3985 __Pyx_RefNannyFinishContext();
3989 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3990 PyObject *__pyx_r = NULL;
3991 __Pyx_RefNannyDeclarations
3992 PyObject *__pyx_t_1 = NULL;
3993 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
4000 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
4001 __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4002 __Pyx_GOTREF(__pyx_t_1);
4003 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4013 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4016 __Pyx_XDECREF(__pyx_t_1);
4017 __Pyx_AddTraceback(
"BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4020 __Pyx_XGIVEREF(__pyx_r);
4021 __Pyx_RefNannyFinishContext();
4034 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4035 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4037 __Pyx_RefNannyDeclarations
4038 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
4039 if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4040 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args));
return -1;}
4041 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds,
"__init__", 0)))
return -1;
4042 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4045 __Pyx_RefNannyFinishContext();
4049 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4051 __Pyx_RefNannyDeclarations
4052 __Pyx_RefNannySetupContext(
"__init__", 0);
4061 __Pyx_INCREF(Py_None);
4062 __Pyx_GIVEREF(Py_None);
4063 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4064 __Pyx_DECREF(__pyx_v_self->uOfXT);
4065 __pyx_v_self->uOfXT = Py_None;
4077 __Pyx_RefNannyFinishContext();
4090 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4091 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0};
4092 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4093 PyObject *__pyx_r = 0;
4094 __Pyx_RefNannyDeclarations
4095 __Pyx_RefNannySetupContext(
"init_cython (wrapper)", 0);
4096 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4099 __Pyx_RefNannyFinishContext();
4103 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4104 PyObject *__pyx_r = NULL;
4105 __Pyx_RefNannyDeclarations
4106 __Pyx_RefNannySetupContext(
"init_cython", 0);
4115 __Pyx_XDECREF(__pyx_r);
4116 __Pyx_INCREF(__pyx_v_self->uOfXT);
4117 __pyx_r = __pyx_v_self->uOfXT;
4130 __Pyx_XGIVEREF(__pyx_r);
4131 __Pyx_RefNannyFinishContext();
4143 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4144 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self,
int __pyx_skip_dispatch) {
4145 __Pyx_RefNannyDeclarations
4146 PyObject *__pyx_t_1 = NULL;
4147 PyObject *__pyx_t_2 = NULL;
4148 PyObject *__pyx_t_3 = NULL;
4149 PyObject *__pyx_t_4 = NULL;
4150 __Pyx_RefNannySetupContext(
"resetBC", 0);
4152 if (unlikely(__pyx_skip_dispatch)) ;
4154 else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
4155 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
4156 __Pyx_GOTREF(__pyx_t_1);
4157 if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4158 __Pyx_INCREF(__pyx_t_1);
4159 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4160 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4161 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4162 if (likely(__pyx_t_4)) {
4163 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
4164 __Pyx_INCREF(__pyx_t_4);
4165 __Pyx_INCREF(
function);
4166 __Pyx_DECREF_SET(__pyx_t_3,
function);
4170 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
4171 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4173 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
4175 __Pyx_GOTREF(__pyx_t_2);
4176 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4177 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4178 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4191 __Pyx_INCREF(Py_None);
4192 __Pyx_GIVEREF(Py_None);
4193 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4194 __Pyx_DECREF(__pyx_v_self->uOfXT);
4195 __pyx_v_self->uOfXT = Py_None;
4208 __Pyx_XDECREF(__pyx_t_1);
4209 __Pyx_XDECREF(__pyx_t_2);
4210 __Pyx_XDECREF(__pyx_t_3);
4211 __Pyx_XDECREF(__pyx_t_4);
4212 __Pyx_WriteUnraisable(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4214 __Pyx_RefNannyFinishContext();
4218 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
4219 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {
"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, 0};
4220 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4221 PyObject *__pyx_r = 0;
4222 __Pyx_RefNannyDeclarations
4223 __Pyx_RefNannySetupContext(
"resetBC (wrapper)", 0);
4224 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4227 __Pyx_RefNannyFinishContext();
4231 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4232 PyObject *__pyx_r = NULL;
4233 __Pyx_RefNannyDeclarations
4234 PyObject *__pyx_t_1 = NULL;
4235 __Pyx_RefNannySetupContext(
"resetBC", 0);
4236 __Pyx_XDECREF(__pyx_r);
4237 __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
4238 __Pyx_GOTREF(__pyx_t_1);
4239 __pyx_r = __pyx_t_1;
4245 __Pyx_XDECREF(__pyx_t_1);
4246 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4249 __Pyx_XGIVEREF(__pyx_r);
4250 __Pyx_RefNannyFinishContext();
4263 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4264 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] =
"\n function returning constant BC\n\n Parameters\n ----------\n value : float\n Constant value\n\n ";
4265 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4266 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4267 PyObject *__pyx_r = 0;
4268 __Pyx_RefNannyDeclarations
4269 __Pyx_RefNannySetupContext(
"setConstantBC (wrapper)", 0);
4270 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4273 __Pyx_RefNannyFinishContext();
4286 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4287 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {
"lambda", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4288 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4289 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4290 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4291 PyObject *__pyx_r = 0;
4292 __Pyx_RefNannyDeclarations
4293 __Pyx_RefNannySetupContext(
"lambda (wrapper)", 0);
4295 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4296 PyObject* values[2] = {0,0};
4297 if (unlikely(__pyx_kwds)) {
4299 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4301 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4303 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4306 default:
goto __pyx_L5_argtuple_error;
4308 kw_args = PyDict_Size(__pyx_kwds);
4311 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4312 else goto __pyx_L5_argtuple_error;
4315 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4317 __Pyx_RaiseArgtupleInvalid(
"lambda", 1, 2, 2, 1); __PYX_ERR(0, 86, __pyx_L3_error)
4320 if (unlikely(kw_args > 0)) {
4321 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda") < 0)) __PYX_ERR(0, 86, __pyx_L3_error)
4323 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4324 goto __pyx_L5_argtuple_error;
4326 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4327 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4329 __pyx_v_x = values[0];
4330 __pyx_v_t = values[1];
4332 goto __pyx_L4_argument_unpacking_done;
4333 __pyx_L5_argtuple_error:;
4334 __Pyx_RaiseArgtupleInvalid(
"lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 86, __pyx_L3_error)
4336 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4337 __Pyx_RefNannyFinishContext();
4339 __pyx_L4_argument_unpacking_done:;
4340 __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t);
4343 __Pyx_RefNannyFinishContext();
4347 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4348 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4349 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4350 PyObject *__pyx_r = NULL;
4351 __Pyx_RefNannyDeclarations
4352 __Pyx_RefNannySetupContext(
"lambda", 0);
4353 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4354 __pyx_cur_scope = __pyx_outer_scope;
4355 __Pyx_XDECREF(__pyx_r);
4356 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 86, __pyx_L1_error) }
4357 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4358 __pyx_r = __pyx_cur_scope->__pyx_v_value;
4363 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4366 __Pyx_XGIVEREF(__pyx_r);
4367 __Pyx_RefNannyFinishContext();
4379 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4380 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4381 PyObject *__pyx_r = NULL;
4382 __Pyx_RefNannyDeclarations
4383 PyObject *__pyx_t_1 = NULL;
4384 __Pyx_RefNannySetupContext(
"setConstantBC", 0);
4385 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
4386 if (unlikely(!__pyx_cur_scope)) {
4387 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
4388 __Pyx_INCREF(Py_None);
4389 __PYX_ERR(0, 76, __pyx_L1_error)
4391 __Pyx_GOTREF(__pyx_cur_scope);
4393 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4394 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4395 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4404 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
4405 __Pyx_GOTREF(__pyx_t_1);
4406 __Pyx_GIVEREF(__pyx_t_1);
4407 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4408 __Pyx_DECREF(__pyx_v_self->uOfXT);
4409 __pyx_v_self->uOfXT = __pyx_t_1;
4421 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4424 __Pyx_XDECREF(__pyx_t_1);
4425 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4428 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4429 __Pyx_XGIVEREF(__pyx_r);
4430 __Pyx_RefNannyFinishContext();
4443 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4444 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC[] =
"\n function returning value=a0+ax*x+ay*y+az*z\n\n Parameters\n ----------\n a0 : float\n constant\n a: numpy.ndarray\n ax,ay,az\n\n ";
4445 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {
"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC};
4446 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4447 PyObject *__pyx_v_a0 = 0;
4448 PyObject *__pyx_v_a = 0;
4449 PyObject *__pyx_r = 0;
4450 __Pyx_RefNannyDeclarations
4451 __Pyx_RefNannySetupContext(
"setLinearBC (wrapper)", 0);
4453 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a,0};
4454 PyObject* values[2] = {0,0};
4455 if (unlikely(__pyx_kwds)) {
4457 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4459 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4461 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4464 default:
goto __pyx_L5_argtuple_error;
4466 kw_args = PyDict_Size(__pyx_kwds);
4469 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
4470 else goto __pyx_L5_argtuple_error;
4473 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
4475 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, 1); __PYX_ERR(0, 89, __pyx_L3_error)
4478 if (unlikely(kw_args > 0)) {
4479 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearBC") < 0)) __PYX_ERR(0, 89, __pyx_L3_error)
4481 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4482 goto __pyx_L5_argtuple_error;
4484 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4485 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4487 __pyx_v_a0 = values[0];
4488 __pyx_v_a = values[1];
4490 goto __pyx_L4_argument_unpacking_done;
4491 __pyx_L5_argtuple_error:;
4492 __Pyx_RaiseArgtupleInvalid(
"setLinearBC", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 89, __pyx_L3_error)
4494 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4495 __Pyx_RefNannyFinishContext();
4497 __pyx_L4_argument_unpacking_done:;
4498 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a);
4501 __Pyx_RefNannyFinishContext();
4514 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4515 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {
"lambda1", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
4516 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4517 PyObject *__pyx_v_x = 0;
4518 CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4519 PyObject *__pyx_r = 0;
4520 __Pyx_RefNannyDeclarations
4521 __Pyx_RefNannySetupContext(
"lambda1 (wrapper)", 0);
4523 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4524 PyObject* values[2] = {0,0};
4525 if (unlikely(__pyx_kwds)) {
4527 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4529 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4531 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4534 default:
goto __pyx_L5_argtuple_error;
4536 kw_args = PyDict_Size(__pyx_kwds);
4539 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4540 else goto __pyx_L5_argtuple_error;
4543 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4545 __Pyx_RaiseArgtupleInvalid(
"lambda1", 1, 2, 2, 1); __PYX_ERR(0, 102, __pyx_L3_error)
4548 if (unlikely(kw_args > 0)) {
4549 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda1") < 0)) __PYX_ERR(0, 102, __pyx_L3_error)
4551 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4552 goto __pyx_L5_argtuple_error;
4554 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4555 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4557 __pyx_v_x = values[0];
4558 __pyx_v_t = values[1];
4560 goto __pyx_L4_argument_unpacking_done;
4561 __pyx_L5_argtuple_error:;
4562 __Pyx_RaiseArgtupleInvalid(
"lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error)
4564 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4565 __Pyx_RefNannyFinishContext();
4567 __pyx_L4_argument_unpacking_done:;
4568 __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t);
4571 __Pyx_RefNannyFinishContext();
4575 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4576 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4577 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
4578 PyObject *__pyx_r = NULL;
4579 __Pyx_RefNannyDeclarations
4580 PyObject *__pyx_t_1 = NULL;
4581 PyObject *__pyx_t_2 = NULL;
4582 PyObject *__pyx_t_3 = NULL;
4583 __Pyx_RefNannySetupContext(
"lambda1", 0);
4584 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4585 __pyx_cur_scope = __pyx_outer_scope;
4586 __Pyx_XDECREF(__pyx_r);
4587 if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError(
"a0"); __PYX_ERR(0, 102, __pyx_L1_error) }
4588 if (unlikely(!__pyx_cur_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError(
"a"); __PYX_ERR(0, 102, __pyx_L1_error) }
4589 __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_a, 0, 0, NULL, NULL, &__pyx_slice_, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
4590 __Pyx_GOTREF(__pyx_t_1);
4591 __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__2, 0, 0, 1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
4592 __Pyx_GOTREF(__pyx_t_2);
4593 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
4594 __Pyx_GOTREF(__pyx_t_3);
4595 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4596 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4597 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
4598 __Pyx_GOTREF(__pyx_t_2);
4599 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4600 __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
4601 __Pyx_GOTREF(__pyx_t_3);
4602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4603 __pyx_r = __pyx_t_3;
4609 __Pyx_XDECREF(__pyx_t_1);
4610 __Pyx_XDECREF(__pyx_t_2);
4611 __Pyx_XDECREF(__pyx_t_3);
4612 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4615 __Pyx_XGIVEREF(__pyx_r);
4616 __Pyx_RefNannyFinishContext();
4628 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a) {
4629 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4630 PyObject *__pyx_r = NULL;
4631 __Pyx_RefNannyDeclarations
4632 PyObject *__pyx_t_1 = NULL;
4633 __Pyx_RefNannySetupContext(
"setLinearBC", 0);
4634 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
4635 if (unlikely(!__pyx_cur_scope)) {
4636 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
4637 __Pyx_INCREF(Py_None);
4638 __PYX_ERR(0, 89, __pyx_L1_error)
4640 __Pyx_GOTREF(__pyx_cur_scope);
4642 __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
4643 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
4644 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
4645 __pyx_cur_scope->__pyx_v_a = __pyx_v_a;
4646 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
4647 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
4656 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
4657 __Pyx_GOTREF(__pyx_t_1);
4658 __Pyx_GIVEREF(__pyx_t_1);
4659 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4660 __Pyx_DECREF(__pyx_v_self->uOfXT);
4661 __pyx_v_self->uOfXT = __pyx_t_1;
4673 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4676 __Pyx_XDECREF(__pyx_t_1);
4677 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4680 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4681 __Pyx_XGIVEREF(__pyx_r);
4682 __Pyx_RefNannyFinishContext();
4695 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4696 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp[] =
"\n function setting a linear ramp from t=0 to t=t1\n\n Parameters\n -----------\n t1: float\n Ramp end time\n value: float\n Variable value\n ";
4697 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp = {
"setLinearRamp", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp};
4698 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4699 PyObject *__pyx_v_t1 = 0;
4700 PyObject *__pyx_v_value = 0;
4701 PyObject *__pyx_r = 0;
4702 __Pyx_RefNannyDeclarations
4703 __Pyx_RefNannySetupContext(
"setLinearRamp (wrapper)", 0);
4705 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t1,&__pyx_n_s_value,0};
4706 PyObject* values[2] = {0,0};
4707 if (unlikely(__pyx_kwds)) {
4709 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4711 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4713 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4716 default:
goto __pyx_L5_argtuple_error;
4718 kw_args = PyDict_Size(__pyx_kwds);
4721 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t1)) != 0)) kw_args--;
4722 else goto __pyx_L5_argtuple_error;
4725 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
4727 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, 1); __PYX_ERR(0, 104, __pyx_L3_error)
4730 if (unlikely(kw_args > 0)) {
4731 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setLinearRamp") < 0)) __PYX_ERR(0, 104, __pyx_L3_error)
4733 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4734 goto __pyx_L5_argtuple_error;
4736 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4737 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4739 __pyx_v_t1 = values[0];
4740 __pyx_v_value = values[1];
4742 goto __pyx_L4_argument_unpacking_done;
4743 __pyx_L5_argtuple_error:;
4744 __Pyx_RaiseArgtupleInvalid(
"setLinearRamp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 104, __pyx_L3_error)
4746 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
4747 __Pyx_RefNannyFinishContext();
4749 __pyx_L4_argument_unpacking_done:;
4750 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_t1, __pyx_v_value);
4753 __Pyx_RefNannyFinishContext();
4764 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4765 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2 = {
"lambda2", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, METH_VARARGS|METH_KEYWORDS, 0};
4766 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4767 CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4768 PyObject *__pyx_v_t = 0;
4769 PyObject *__pyx_r = 0;
4770 __Pyx_RefNannyDeclarations
4771 __Pyx_RefNannySetupContext(
"lambda2 (wrapper)", 0);
4773 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4774 PyObject* values[2] = {0,0};
4775 if (unlikely(__pyx_kwds)) {
4777 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4779 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4781 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4784 default:
goto __pyx_L5_argtuple_error;
4786 kw_args = PyDict_Size(__pyx_kwds);
4789 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4790 else goto __pyx_L5_argtuple_error;
4793 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4795 __Pyx_RaiseArgtupleInvalid(
"lambda2", 1, 2, 2, 1); __PYX_ERR(0, 115, __pyx_L3_error)
4798 if (unlikely(kw_args > 0)) {
4799 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"lambda2") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
4801 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4802 goto __pyx_L5_argtuple_error;
4804 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4805 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4807 __pyx_v_x = values[0];
4808 __pyx_v_t = values[1];
4810 goto __pyx_L4_argument_unpacking_done;
4811 __pyx_L5_argtuple_error:;
4812 __Pyx_RaiseArgtupleInvalid(
"lambda2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
4814 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4815 __Pyx_RefNannyFinishContext();
4817 __pyx_L4_argument_unpacking_done:;
4818 __pyx_r = __pyx_lambda_funcdef_lambda2(__pyx_self, __pyx_v_x, __pyx_v_t);
4821 __Pyx_RefNannyFinishContext();
4825 static PyObject *__pyx_lambda_funcdef_lambda2(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
4826 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
4827 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_outer_scope;
4828 PyObject *__pyx_r = NULL;
4829 __Pyx_RefNannyDeclarations
4831 PyObject *__pyx_t_2 = NULL;
4832 PyObject *__pyx_t_3 = NULL;
4833 PyObject *__pyx_t_4 = NULL;
4834 PyObject *__pyx_t_5 = NULL;
4836 __Pyx_RefNannySetupContext(
"lambda2", 0);
4837 __pyx_outer_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *) __Pyx_CyFunction_GetClosure(__pyx_self);
4838 __pyx_cur_scope = __pyx_outer_scope;
4839 __Pyx_XDECREF(__pyx_r);
4841 if (unlikely(!__pyx_cur_scope->__pyx_v_t1)) { __Pyx_RaiseClosureNameError(
"t1"); __PYX_ERR(0, 115, __pyx_L1_error) }
4842 __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_cur_scope->__pyx_v_t1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
4843 __Pyx_GOTREF(__pyx_t_2);
4844 __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
4845 __Pyx_GOTREF(__pyx_t_4);
4846 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
4847 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4848 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
4849 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4851 __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
4852 __Pyx_GOTREF(__pyx_t_5);
4853 __pyx_t_3 = __pyx_t_5;
4856 __Pyx_INCREF(__pyx_t_2);
4857 __pyx_t_3 = __pyx_t_2;
4859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4860 if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError(
"value"); __PYX_ERR(0, 115, __pyx_L1_error) }
4861 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_cur_scope->__pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
4862 __Pyx_GOTREF(__pyx_t_2);
4863 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4864 __pyx_r = __pyx_t_2;
4870 __Pyx_XDECREF(__pyx_t_2);
4871 __Pyx_XDECREF(__pyx_t_3);
4872 __Pyx_XDECREF(__pyx_t_4);
4873 __Pyx_XDECREF(__pyx_t_5);
4874 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
4877 __Pyx_XGIVEREF(__pyx_r);
4878 __Pyx_RefNannyFinishContext();
4890 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10setLinearRamp(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_t1, PyObject *__pyx_v_value) {
4891 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_cur_scope;
4892 PyObject *__pyx_r = NULL;
4893 __Pyx_RefNannyDeclarations
4894 PyObject *__pyx_t_1 = NULL;
4895 __Pyx_RefNannySetupContext(
"setLinearRamp", 0);
4896 __pyx_cur_scope = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp, __pyx_empty_tuple, NULL);
4897 if (unlikely(!__pyx_cur_scope)) {
4898 __pyx_cur_scope = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)Py_None);
4899 __Pyx_INCREF(Py_None);
4900 __PYX_ERR(0, 104, __pyx_L1_error)
4902 __Pyx_GOTREF(__pyx_cur_scope);
4904 __pyx_cur_scope->__pyx_v_t1 = __pyx_v_t1;
4905 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_t1);
4906 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_t1);
4907 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4908 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4909 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4916 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setLinearRamp_lambda2, 0, __pyx_n_s_setLinearRamp_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
4917 __Pyx_GOTREF(__pyx_t_1);
4918 __Pyx_GIVEREF(__pyx_t_1);
4919 __Pyx_GOTREF(__pyx_v_self->uOfXT);
4920 __Pyx_DECREF(__pyx_v_self->uOfXT);
4921 __pyx_v_self->uOfXT = __pyx_t_1;
4933 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4936 __Pyx_XDECREF(__pyx_t_1);
4937 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.setLinearRamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
4940 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4941 __Pyx_XGIVEREF(__pyx_r);
4942 __Pyx_RefNannyFinishContext();
4955 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self);
4956 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
4957 PyObject *__pyx_r = 0;
4958 __Pyx_RefNannyDeclarations
4959 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
4960 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4963 __Pyx_RefNannyFinishContext();
4967 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4968 PyObject *__pyx_r = NULL;
4969 __Pyx_RefNannyDeclarations
4970 __Pyx_RefNannySetupContext(
"__get__", 0);
4971 __Pyx_XDECREF(__pyx_r);
4972 __Pyx_INCREF(__pyx_v_self->uOfXT);
4973 __pyx_r = __pyx_v_self->uOfXT;
4978 __Pyx_XGIVEREF(__pyx_r);
4979 __Pyx_RefNannyFinishContext();
4984 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value);
4985 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4987 __Pyx_RefNannyDeclarations
4988 __Pyx_RefNannySetupContext(
"__set__ (wrapper)", 0);
4989 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4992 __Pyx_RefNannyFinishContext();
4996 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4998 __Pyx_RefNannyDeclarations
4999 __Pyx_RefNannySetupContext(
"__set__", 0);
5000 __Pyx_INCREF(__pyx_v_value);
5001 __Pyx_GIVEREF(__pyx_v_value);
5002 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5003 __Pyx_DECREF(__pyx_v_self->uOfXT);
5004 __pyx_v_self->uOfXT = __pyx_v_value;
5008 __Pyx_RefNannyFinishContext();
5013 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self);
5014 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
5016 __Pyx_RefNannyDeclarations
5017 __Pyx_RefNannySetupContext(
"__del__ (wrapper)", 0);
5018 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5021 __Pyx_RefNannyFinishContext();
5025 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5027 __Pyx_RefNannyDeclarations
5028 __Pyx_RefNannySetupContext(
"__del__", 0);
5029 __Pyx_INCREF(Py_None);
5030 __Pyx_GIVEREF(Py_None);
5031 __Pyx_GOTREF(__pyx_v_self->uOfXT);
5032 __Pyx_DECREF(__pyx_v_self->uOfXT);
5033 __pyx_v_self->uOfXT = Py_None;
5037 __Pyx_RefNannyFinishContext();
5048 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
5049 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, 0};
5050 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5051 PyObject *__pyx_r = 0;
5052 __Pyx_RefNannyDeclarations
5053 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
5054 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
5057 __Pyx_RefNannyFinishContext();
5061 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
5062 PyObject *__pyx_r = NULL;
5063 __Pyx_RefNannyDeclarations
5064 PyObject *__pyx_t_1 = NULL;
5065 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
5073 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5074 __Pyx_GOTREF(__pyx_t_1);
5075 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5076 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5077 __PYX_ERR(1, 2, __pyx_L1_error)
5087 __Pyx_XDECREF(__pyx_t_1);
5088 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5090 __Pyx_XGIVEREF(__pyx_r);
5091 __Pyx_RefNannyFinishContext();
5103 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
5104 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, 0};
5105 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5106 PyObject *__pyx_r = 0;
5107 __Pyx_RefNannyDeclarations
5108 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
5109 __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5112 __Pyx_RefNannyFinishContext();
5116 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_14__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5117 PyObject *__pyx_r = NULL;
5118 __Pyx_RefNannyDeclarations
5119 PyObject *__pyx_t_1 = NULL;
5120 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
5127 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5128 __Pyx_GOTREF(__pyx_t_1);
5129 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5130 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5131 __PYX_ERR(1, 4, __pyx_L1_error)
5142 __Pyx_XDECREF(__pyx_t_1);
5143 __Pyx_AddTraceback(
"BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5145 __Pyx_XGIVEREF(__pyx_r);
5146 __Pyx_RefNannyFinishContext();
5157 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5158 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {
"__pyx_unpickle_BC_Base", (PyCFunction)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, 0};
5159 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5160 PyObject *__pyx_v___pyx_type = 0;
5161 long __pyx_v___pyx_checksum;
5162 PyObject *__pyx_v___pyx_state = 0;
5163 PyObject *__pyx_r = 0;
5164 __Pyx_RefNannyDeclarations
5165 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base (wrapper)", 0);
5167 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
5168 PyObject* values[3] = {0,0,0};
5169 if (unlikely(__pyx_kwds)) {
5171 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5173 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5175 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5177 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5180 default:
goto __pyx_L5_argtuple_error;
5182 kw_args = PyDict_Size(__pyx_kwds);
5185 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
5186 else goto __pyx_L5_argtuple_error;
5189 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
5191 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
5195 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
5197 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
5200 if (unlikely(kw_args > 0)) {
5201 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
5203 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5204 goto __pyx_L5_argtuple_error;
5206 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5207 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5208 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5210 __pyx_v___pyx_type = values[0];
5211 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
5212 __pyx_v___pyx_state = values[2];
5214 goto __pyx_L4_argument_unpacking_done;
5215 __pyx_L5_argtuple_error:;
5216 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
5218 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5219 __Pyx_RefNannyFinishContext();
5221 __pyx_L4_argument_unpacking_done:;
5222 __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
5225 __Pyx_RefNannyFinishContext();
5229 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
5230 PyObject *__pyx_v___pyx_PickleError = NULL;
5231 PyObject *__pyx_v___pyx_result = NULL;
5232 PyObject *__pyx_r = NULL;
5233 __Pyx_RefNannyDeclarations
5235 PyObject *__pyx_t_2 = NULL;
5236 PyObject *__pyx_t_3 = NULL;
5237 PyObject *__pyx_t_4 = NULL;
5238 PyObject *__pyx_t_5 = NULL;
5239 PyObject *__pyx_t_6 = NULL;
5241 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base", 0);
5249 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
5259 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
5260 __Pyx_GOTREF(__pyx_t_2);
5261 __Pyx_INCREF(__pyx_n_s_PickleError);
5262 __Pyx_GIVEREF(__pyx_n_s_PickleError);
5263 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
5264 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
5265 __Pyx_GOTREF(__pyx_t_3);
5266 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5267 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
5268 __Pyx_GOTREF(__pyx_t_2);
5269 __Pyx_INCREF(__pyx_t_2);
5270 __pyx_v___pyx_PickleError = __pyx_t_2;
5271 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5281 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
5282 __Pyx_GOTREF(__pyx_t_2);
5283 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
5284 __Pyx_GOTREF(__pyx_t_4);
5285 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5286 __Pyx_INCREF(__pyx_v___pyx_PickleError);
5287 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
5288 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5289 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
5290 if (likely(__pyx_t_5)) {
5291 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5292 __Pyx_INCREF(__pyx_t_5);
5293 __Pyx_INCREF(
function);
5294 __Pyx_DECREF_SET(__pyx_t_2,
function);
5298 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5300 __Pyx_GOTREF(__pyx_t_3);
5302 #if CYTHON_FAST_PYCALL
5303 if (PyFunction_Check(__pyx_t_2)) {
5304 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5305 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5306 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5307 __Pyx_GOTREF(__pyx_t_3);
5308 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5311 #if CYTHON_FAST_PYCCALL
5312 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5313 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5314 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5315 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5316 __Pyx_GOTREF(__pyx_t_3);
5317 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5321 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
5322 __Pyx_GOTREF(__pyx_t_6);
5323 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
5324 __Pyx_GIVEREF(__pyx_t_4);
5325 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
5327 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
5328 __Pyx_GOTREF(__pyx_t_3);
5329 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5332 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5333 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5334 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5335 __PYX_ERR(1, 4, __pyx_L1_error)
5352 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
5353 __Pyx_GOTREF(__pyx_t_2);
5355 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5356 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
5357 if (likely(__pyx_t_6)) {
5358 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
5359 __Pyx_INCREF(__pyx_t_6);
5360 __Pyx_INCREF(
function);
5361 __Pyx_DECREF_SET(__pyx_t_2,
function);
5365 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5366 __Pyx_GOTREF(__pyx_t_3);
5368 #if CYTHON_FAST_PYCALL
5369 if (PyFunction_Check(__pyx_t_2)) {
5370 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5371 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5372 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5373 __Pyx_GOTREF(__pyx_t_3);
5376 #if CYTHON_FAST_PYCCALL
5377 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5378 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5379 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5380 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5381 __Pyx_GOTREF(__pyx_t_3);
5385 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
5386 __Pyx_GOTREF(__pyx_t_4);
5387 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
5388 __Pyx_INCREF(__pyx_v___pyx_type);
5389 __Pyx_GIVEREF(__pyx_v___pyx_type);
5390 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
5391 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
5392 __Pyx_GOTREF(__pyx_t_3);
5393 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5397 __pyx_v___pyx_result = __pyx_t_3;
5407 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
5408 __pyx_t_7 = (__pyx_t_1 != 0);
5418 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
5419 __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((
struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
5420 __Pyx_GOTREF(__pyx_t_3);
5421 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5439 __Pyx_XDECREF(__pyx_r);
5440 __Pyx_INCREF(__pyx_v___pyx_result);
5441 __pyx_r = __pyx_v___pyx_result;
5452 __Pyx_XDECREF(__pyx_t_2);
5453 __Pyx_XDECREF(__pyx_t_3);
5454 __Pyx_XDECREF(__pyx_t_4);
5455 __Pyx_XDECREF(__pyx_t_5);
5456 __Pyx_XDECREF(__pyx_t_6);
5457 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5460 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
5461 __Pyx_XDECREF(__pyx_v___pyx_result);
5462 __Pyx_XGIVEREF(__pyx_r);
5463 __Pyx_RefNannyFinishContext();
5475 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(
struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
5476 PyObject *__pyx_r = NULL;
5477 __Pyx_RefNannyDeclarations
5478 PyObject *__pyx_t_1 = NULL;
5479 __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5482 Py_ssize_t __pyx_t_5;
5485 PyObject *__pyx_t_8 = NULL;
5486 PyObject *__pyx_t_9 = NULL;
5487 PyObject *__pyx_t_10 = NULL;
5488 PyObject *__pyx_t_11 = NULL;
5489 __Pyx_RefNannySetupContext(
"__pyx_unpickle_BC_Base__set_state", 0);
5498 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5499 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5500 __PYX_ERR(1, 10, __pyx_L1_error)
5502 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5503 __Pyx_GOTREF(__pyx_t_1);
5504 if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 10, __pyx_L1_error)
5505 __Pyx_GIVEREF(__pyx_t_1);
5506 __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
5507 __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
5508 __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
5510 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5511 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5512 __PYX_ERR(1, 10, __pyx_L1_error)
5514 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5515 __Pyx_GOTREF(__pyx_t_1);
5516 __Pyx_GIVEREF(__pyx_t_1);
5517 __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
5518 __Pyx_DECREF(__pyx_v___pyx_result->Shape);
5519 __pyx_v___pyx_result->Shape = __pyx_t_1;
5521 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5522 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5523 __PYX_ERR(1, 10, __pyx_L1_error)
5525 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5526 __Pyx_GOTREF(__pyx_t_1);
5527 __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(1, 10, __pyx_L1_error)
5528 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5529 __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
5530 __pyx_v___pyx_result->_b_or = __pyx_t_2;
5531 __pyx_t_2.memview = NULL;
5532 __pyx_t_2.data = NULL;
5533 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5534 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5535 __PYX_ERR(1, 10, __pyx_L1_error)
5537 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5538 __Pyx_GOTREF(__pyx_t_1);
5539 __Pyx_GIVEREF(__pyx_t_1);
5540 __Pyx_GOTREF(__pyx_v___pyx_result->ct);
5541 __Pyx_DECREF(__pyx_v___pyx_result->ct);
5542 __pyx_v___pyx_result->ct = __pyx_t_1;
5544 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5545 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5546 __PYX_ERR(1, 10, __pyx_L1_error)
5548 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5549 __Pyx_GOTREF(__pyx_t_1);
5550 if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 10, __pyx_L1_error)
5551 __Pyx_GIVEREF(__pyx_t_1);
5552 __Pyx_GOTREF(__pyx_v___pyx_result->name);
5553 __Pyx_DECREF(__pyx_v___pyx_result->name);
5554 __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
5556 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5557 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5558 __PYX_ERR(1, 10, __pyx_L1_error)
5560 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
5561 __Pyx_GOTREF(__pyx_t_1);
5562 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 10, __pyx_L1_error)
5563 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5564 __pyx_v___pyx_result->nd = __pyx_t_3;
5572 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5573 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
5574 __PYX_ERR(1, 11, __pyx_L1_error)
5576 __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
5577 __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
5580 __pyx_t_4 = __pyx_t_6;
5581 goto __pyx_L4_bool_binop_done;
5583 __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
5584 __pyx_t_7 = (__pyx_t_6 != 0);
5585 __pyx_t_4 = __pyx_t_7;
5586 __pyx_L4_bool_binop_done:;
5594 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error)
5595 __Pyx_GOTREF(__pyx_t_8);
5596 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
5597 __Pyx_GOTREF(__pyx_t_9);
5598 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5599 if (unlikely(__pyx_v___pyx_state == Py_None)) {
5600 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5601 __PYX_ERR(1, 12, __pyx_L1_error)
5603 __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 12, __pyx_L1_error)
5604 __Pyx_GOTREF(__pyx_t_8);
5606 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
5607 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
5608 if (likely(__pyx_t_10)) {
5609 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
5610 __Pyx_INCREF(__pyx_t_10);
5611 __Pyx_INCREF(
function);
5612 __Pyx_DECREF_SET(__pyx_t_9,
function);
5616 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5617 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5618 __Pyx_GOTREF(__pyx_t_1);
5620 #if CYTHON_FAST_PYCALL
5621 if (PyFunction_Check(__pyx_t_9)) {
5622 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5623 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5624 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5625 __Pyx_GOTREF(__pyx_t_1);
5626 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5629 #if CYTHON_FAST_PYCCALL
5630 if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5631 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5632 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5633 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5634 __Pyx_GOTREF(__pyx_t_1);
5635 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5639 __pyx_t_11 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 12, __pyx_L1_error)
5640 __Pyx_GOTREF(__pyx_t_11);
5641 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
5642 __Pyx_GIVEREF(__pyx_t_8);
5643 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8);
5645 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
5646 __Pyx_GOTREF(__pyx_t_1);
5647 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5650 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5651 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5670 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5673 __Pyx_XDECREF(__pyx_t_1);
5674 __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5675 __Pyx_XDECREF(__pyx_t_8);
5676 __Pyx_XDECREF(__pyx_t_9);
5677 __Pyx_XDECREF(__pyx_t_10);
5678 __Pyx_XDECREF(__pyx_t_11);
5679 __Pyx_AddTraceback(
"BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
5682 __Pyx_XGIVEREF(__pyx_r);
5683 __Pyx_RefNannyFinishContext();
5696 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
5697 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5699 __Pyx_RefNannyDeclarations
5700 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
5701 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
5704 __Pyx_RefNannyFinishContext();
5708 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
5711 int __pyx_v_endian_detector;
5712 int __pyx_v_little_endian;
5715 PyArray_Descr *__pyx_v_descr = 0;
5718 __Pyx_RefNannyDeclarations
5721 PyObject *__pyx_t_3 = NULL;
5725 PyObject *__pyx_t_7 = NULL;
5727 if (__pyx_v_info == NULL) {
5728 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
5731 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
5732 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5733 __Pyx_GIVEREF(__pyx_v_info->obj);
5742 __pyx_v_endian_detector = 1;
5751 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
5760 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
5769 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
5772 __pyx_t_1 = __pyx_t_2;
5773 goto __pyx_L4_bool_binop_done;
5783 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
5784 __pyx_t_1 = __pyx_t_2;
5785 __pyx_L4_bool_binop_done:;
5794 if (unlikely(__pyx_t_1)) {
5803 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 229, __pyx_L1_error)
5804 __Pyx_GOTREF(__pyx_t_3);
5805 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5806 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5807 __PYX_ERR(3, 229, __pyx_L1_error)
5825 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
5828 __pyx_t_1 = __pyx_t_2;
5829 goto __pyx_L7_bool_binop_done;
5839 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
5840 __pyx_t_1 = __pyx_t_2;
5841 __pyx_L7_bool_binop_done:;
5850 if (unlikely(__pyx_t_1)) {
5859 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 233, __pyx_L1_error)
5860 __Pyx_GOTREF(__pyx_t_3);
5861 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5863 __PYX_ERR(3, 233, __pyx_L1_error)
5881 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
5890 __pyx_v_info->ndim = __pyx_v_ndim;
5899 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
5909 __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
5918 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
5927 __pyx_t_4 = __pyx_v_ndim;
5928 __pyx_t_5 = __pyx_t_4;
5929 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5930 __pyx_v_i = __pyx_t_6;
5939 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
5948 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
5969 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
5978 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
5989 __pyx_v_info->suboffsets = NULL;
5998 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
6007 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
6025 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
6026 __Pyx_INCREF(__pyx_t_3);
6027 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
6037 __Pyx_INCREF(((PyObject *)__pyx_v_self));
6038 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
6039 __Pyx_GOTREF(__pyx_v_info->obj);
6040 __Pyx_DECREF(__pyx_v_info->obj);
6041 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6050 __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
6060 __pyx_t_4 = __pyx_v_descr->type_num;
6061 __pyx_v_t = __pyx_t_4;
6070 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
6072 goto __pyx_L15_next_or;
6075 __pyx_t_2 = (__pyx_v_little_endian != 0);
6078 __pyx_t_1 = __pyx_t_2;
6079 goto __pyx_L14_bool_binop_done;
6090 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
6093 __pyx_t_1 = __pyx_t_2;
6094 goto __pyx_L14_bool_binop_done;
6096 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
6097 __pyx_t_1 = __pyx_t_2;
6098 __pyx_L14_bool_binop_done:;
6107 if (unlikely(__pyx_t_1)) {
6116 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error)
6117 __Pyx_GOTREF(__pyx_t_3);
6118 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6119 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6120 __PYX_ERR(3, 263, __pyx_L1_error)
6138 switch (__pyx_v_t) {
6140 __pyx_v_f = ((
char *)
"b");
6151 __pyx_v_f = ((
char *)
"B");
6162 __pyx_v_f = ((
char *)
"h");
6173 __pyx_v_f = ((
char *)
"H");
6184 __pyx_v_f = ((
char *)
"i");
6195 __pyx_v_f = ((
char *)
"I");
6206 __pyx_v_f = ((
char *)
"l");
6217 __pyx_v_f = ((
char *)
"L");
6228 __pyx_v_f = ((
char *)
"q");
6239 __pyx_v_f = ((
char *)
"Q");
6250 __pyx_v_f = ((
char *)
"f");
6261 __pyx_v_f = ((
char *)
"d");
6271 case NPY_LONGDOUBLE:
6272 __pyx_v_f = ((
char *)
"g");
6283 __pyx_v_f = ((
char *)
"Zf");
6294 __pyx_v_f = ((
char *)
"Zd");
6304 case NPY_CLONGDOUBLE:
6305 __pyx_v_f = ((
char *)
"Zg");
6316 __pyx_v_f = ((
char *)
"O");
6327 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6328 __Pyx_GOTREF(__pyx_t_3);
6329 __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 282, __pyx_L1_error)
6330 __Pyx_GOTREF(__pyx_t_7);
6331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6332 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6333 __Pyx_GOTREF(__pyx_t_3);
6334 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6335 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6336 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6337 __PYX_ERR(3, 282, __pyx_L1_error)
6348 __pyx_v_info->format = __pyx_v_f;
6377 __pyx_v_info->format = ((
char *)PyObject_Malloc(0xFF));
6386 (__pyx_v_info->format[0]) =
'^';
6404 __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_8 == ((
char *)NULL))) __PYX_ERR(3, 289, __pyx_L1_error)
6405 __pyx_v_f = __pyx_t_8;
6414 (__pyx_v_f[0]) =
'\x00';
6429 __Pyx_XDECREF(__pyx_t_3);
6430 __Pyx_XDECREF(__pyx_t_7);
6431 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6433 if (__pyx_v_info->obj != NULL) {
6434 __Pyx_GOTREF(__pyx_v_info->obj);
6435 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6439 if (__pyx_v_info->obj == Py_None) {
6440 __Pyx_GOTREF(__pyx_v_info->obj);
6441 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6444 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6445 __Pyx_RefNannyFinishContext();
6458 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
6459 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6460 __Pyx_RefNannyDeclarations
6461 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
6462 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6465 __Pyx_RefNannyFinishContext();
6468 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6469 __Pyx_RefNannyDeclarations
6471 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
6480 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6490 PyObject_Free(__pyx_v_info->format);
6508 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
6518 PyObject_Free(__pyx_v_info->strides);
6538 __Pyx_RefNannyFinishContext();
6549 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6550 PyObject *__pyx_r = NULL;
6551 __Pyx_RefNannyDeclarations
6552 PyObject *__pyx_t_1 = NULL;
6553 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
6562 __Pyx_XDECREF(__pyx_r);
6563 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 776, __pyx_L1_error)
6564 __Pyx_GOTREF(__pyx_t_1);
6565 __pyx_r = __pyx_t_1;
6579 __Pyx_XDECREF(__pyx_t_1);
6580 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6583 __Pyx_XGIVEREF(__pyx_r);
6584 __Pyx_RefNannyFinishContext();
6596 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6597 PyObject *__pyx_r = NULL;
6598 __Pyx_RefNannyDeclarations
6599 PyObject *__pyx_t_1 = NULL;
6600 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
6609 __Pyx_XDECREF(__pyx_r);
6610 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
6611 __Pyx_GOTREF(__pyx_t_1);
6612 __pyx_r = __pyx_t_1;
6626 __Pyx_XDECREF(__pyx_t_1);
6627 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6630 __Pyx_XGIVEREF(__pyx_r);
6631 __Pyx_RefNannyFinishContext();
6643 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6644 PyObject *__pyx_r = NULL;
6645 __Pyx_RefNannyDeclarations
6646 PyObject *__pyx_t_1 = NULL;
6647 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
6656 __Pyx_XDECREF(__pyx_r);
6657 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 782, __pyx_L1_error)
6658 __Pyx_GOTREF(__pyx_t_1);
6659 __pyx_r = __pyx_t_1;
6673 __Pyx_XDECREF(__pyx_t_1);
6674 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6677 __Pyx_XGIVEREF(__pyx_r);
6678 __Pyx_RefNannyFinishContext();
6690 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6691 PyObject *__pyx_r = NULL;
6692 __Pyx_RefNannyDeclarations
6693 PyObject *__pyx_t_1 = NULL;
6694 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
6703 __Pyx_XDECREF(__pyx_r);
6704 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __pyx_L1_error)
6705 __Pyx_GOTREF(__pyx_t_1);
6706 __pyx_r = __pyx_t_1;
6720 __Pyx_XDECREF(__pyx_t_1);
6721 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6724 __Pyx_XGIVEREF(__pyx_r);
6725 __Pyx_RefNannyFinishContext();
6737 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6738 PyObject *__pyx_r = NULL;
6739 __Pyx_RefNannyDeclarations
6740 PyObject *__pyx_t_1 = NULL;
6741 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
6750 __Pyx_XDECREF(__pyx_r);
6751 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 788, __pyx_L1_error)
6752 __Pyx_GOTREF(__pyx_t_1);
6753 __pyx_r = __pyx_t_1;
6767 __Pyx_XDECREF(__pyx_t_1);
6768 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6771 __Pyx_XGIVEREF(__pyx_r);
6772 __Pyx_RefNannyFinishContext();
6784 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6785 PyObject *__pyx_r = NULL;
6786 __Pyx_RefNannyDeclarations
6788 __Pyx_RefNannySetupContext(
"PyDataType_SHAPE", 0);
6797 __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6807 __Pyx_XDECREF(__pyx_r);
6808 __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6809 __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6829 __Pyx_XDECREF(__pyx_r);
6830 __Pyx_INCREF(__pyx_empty_tuple);
6831 __pyx_r = __pyx_empty_tuple;
6845 __Pyx_XGIVEREF(__pyx_r);
6846 __Pyx_RefNannyFinishContext();
6858 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
6859 PyArray_Descr *__pyx_v_child = 0;
6860 int __pyx_v_endian_detector;
6861 int __pyx_v_little_endian;
6862 PyObject *__pyx_v_fields = 0;
6863 PyObject *__pyx_v_childname = NULL;
6864 PyObject *__pyx_v_new_offset = NULL;
6865 PyObject *__pyx_v_t = NULL;
6867 __Pyx_RefNannyDeclarations
6868 PyObject *__pyx_t_1 = NULL;
6869 Py_ssize_t __pyx_t_2;
6870 PyObject *__pyx_t_3 = NULL;
6871 PyObject *__pyx_t_4 = NULL;
6877 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
6886 __pyx_v_endian_detector = 1;
6895 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
6904 if (unlikely(__pyx_v_descr->names == Py_None)) {
6905 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
6906 __PYX_ERR(3, 805, __pyx_L1_error)
6908 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6910 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
6911 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6912 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) __PYX_ERR(3, 805, __pyx_L1_error)
6914 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
6915 __Pyx_GOTREF(__pyx_t_3);
6917 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6927 if (unlikely(__pyx_v_descr->fields == Py_None)) {
6928 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6929 __PYX_ERR(3, 806, __pyx_L1_error)
6931 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
6932 __Pyx_GOTREF(__pyx_t_3);
6933 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 806, __pyx_L1_error)
6934 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6944 if (likely(__pyx_v_fields != Py_None)) {
6945 PyObject* sequence = __pyx_v_fields;
6946 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6947 if (unlikely(size != 2)) {
6948 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6949 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6950 __PYX_ERR(3, 807, __pyx_L1_error)
6952 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6953 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6954 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6955 __Pyx_INCREF(__pyx_t_3);
6956 __Pyx_INCREF(__pyx_t_4);
6958 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
6959 __Pyx_GOTREF(__pyx_t_3);
6960 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
6961 __Pyx_GOTREF(__pyx_t_4);
6964 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 807, __pyx_L1_error)
6966 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 807, __pyx_L1_error)
6967 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6969 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6979 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
6980 __Pyx_GOTREF(__pyx_t_4);
6981 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
6982 __Pyx_GOTREF(__pyx_t_3);
6983 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6984 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L1_error)
6985 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6986 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
6987 if (unlikely(__pyx_t_6)) {
6996 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
6997 __Pyx_GOTREF(__pyx_t_3);
6998 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6999 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7000 __PYX_ERR(3, 810, __pyx_L1_error)
7018 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
7020 goto __pyx_L8_next_or;
7023 __pyx_t_7 = (__pyx_v_little_endian != 0);
7026 __pyx_t_6 = __pyx_t_7;
7027 goto __pyx_L7_bool_binop_done;
7038 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
7041 __pyx_t_6 = __pyx_t_7;
7042 goto __pyx_L7_bool_binop_done;
7044 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
7045 __pyx_t_6 = __pyx_t_7;
7046 __pyx_L7_bool_binop_done:;
7055 if (unlikely(__pyx_t_6)) {
7064 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
7065 __Pyx_GOTREF(__pyx_t_3);
7066 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7067 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7068 __PYX_ERR(3, 814, __pyx_L1_error)
7087 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 824, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_3);
7089 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 824, __pyx_L1_error)
7090 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7091 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 824, __pyx_L1_error)
7092 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7093 if (!__pyx_t_6)
break;
7102 (__pyx_v_f[0]) = 0x78;
7111 __pyx_v_f = (__pyx_v_f + 1);
7121 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
7132 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
7141 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
7151 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error)
7152 __Pyx_GOTREF(__pyx_t_4);
7153 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
7163 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
7164 if (unlikely(__pyx_t_6)) {
7173 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error)
7174 __Pyx_GOTREF(__pyx_t_4);
7175 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7176 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7177 __PYX_ERR(3, 834, __pyx_L1_error)
7195 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error)
7196 __Pyx_GOTREF(__pyx_t_4);
7197 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error)
7198 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7199 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error)
7200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7202 (__pyx_v_f[0]) = 98;
7213 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error)
7214 __Pyx_GOTREF(__pyx_t_3);
7215 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error)
7216 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7217 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error)
7218 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7220 (__pyx_v_f[0]) = 66;
7231 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error)
7232 __Pyx_GOTREF(__pyx_t_4);
7233 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error)
7234 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7235 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error)
7236 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7238 (__pyx_v_f[0]) = 0x68;
7249 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error)
7250 __Pyx_GOTREF(__pyx_t_3);
7251 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error)
7252 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7253 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error)
7254 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7256 (__pyx_v_f[0]) = 72;
7267 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error)
7268 __Pyx_GOTREF(__pyx_t_4);
7269 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error)
7270 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7271 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error)
7272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7274 (__pyx_v_f[0]) = 0x69;
7285 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error)
7286 __Pyx_GOTREF(__pyx_t_3);
7287 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error)
7288 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7289 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error)
7290 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7292 (__pyx_v_f[0]) = 73;
7303 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 843, __pyx_L1_error)
7304 __Pyx_GOTREF(__pyx_t_4);
7305 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 843, __pyx_L1_error)
7306 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7307 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 843, __pyx_L1_error)
7308 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7310 (__pyx_v_f[0]) = 0x6C;
7321 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error)
7322 __Pyx_GOTREF(__pyx_t_3);
7323 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __pyx_L1_error)
7324 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7325 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 844, __pyx_L1_error)
7326 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7328 (__pyx_v_f[0]) = 76;
7339 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 845, __pyx_L1_error)
7340 __Pyx_GOTREF(__pyx_t_4);
7341 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 845, __pyx_L1_error)
7342 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7343 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 845, __pyx_L1_error)
7344 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7346 (__pyx_v_f[0]) = 0x71;
7357 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 846, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_3);
7359 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 846, __pyx_L1_error)
7360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7361 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 846, __pyx_L1_error)
7362 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7364 (__pyx_v_f[0]) = 81;
7375 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 847, __pyx_L1_error)
7376 __Pyx_GOTREF(__pyx_t_4);
7377 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 847, __pyx_L1_error)
7378 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7379 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 847, __pyx_L1_error)
7380 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7382 (__pyx_v_f[0]) = 0x66;
7393 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 848, __pyx_L1_error)
7394 __Pyx_GOTREF(__pyx_t_3);
7395 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 848, __pyx_L1_error)
7396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7397 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 848, __pyx_L1_error)
7398 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7400 (__pyx_v_f[0]) = 0x64;
7411 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 849, __pyx_L1_error)
7412 __Pyx_GOTREF(__pyx_t_4);
7413 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 849, __pyx_L1_error)
7414 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7415 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 849, __pyx_L1_error)
7416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7418 (__pyx_v_f[0]) = 0x67;
7429 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 850, __pyx_L1_error)
7430 __Pyx_GOTREF(__pyx_t_3);
7431 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 850, __pyx_L1_error)
7432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7433 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 850, __pyx_L1_error)
7434 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7436 (__pyx_v_f[0]) = 90;
7437 (__pyx_v_f[1]) = 0x66;
7438 __pyx_v_f = (__pyx_v_f + 1);
7449 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 851, __pyx_L1_error)
7450 __Pyx_GOTREF(__pyx_t_4);
7451 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
7452 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7453 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
7454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7456 (__pyx_v_f[0]) = 90;
7457 (__pyx_v_f[1]) = 0x64;
7458 __pyx_v_f = (__pyx_v_f + 1);
7469 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
7470 __Pyx_GOTREF(__pyx_t_3);
7471 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 852, __pyx_L1_error)
7472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7473 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 852, __pyx_L1_error)
7474 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7476 (__pyx_v_f[0]) = 90;
7477 (__pyx_v_f[1]) = 0x67;
7478 __pyx_v_f = (__pyx_v_f + 1);
7489 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
7490 __Pyx_GOTREF(__pyx_t_4);
7491 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
7492 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7493 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 853, __pyx_L1_error)
7494 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7495 if (likely(__pyx_t_6)) {
7496 (__pyx_v_f[0]) = 79;
7508 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
7509 __Pyx_GOTREF(__pyx_t_3);
7510 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
7511 __Pyx_GOTREF(__pyx_t_4);
7512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7513 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7514 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7515 __PYX_ERR(3, 855, __pyx_L1_error)
7526 __pyx_v_f = (__pyx_v_f + 1);
7546 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == ((
char *)NULL))) __PYX_ERR(3, 860, __pyx_L1_error)
7547 __pyx_v_f = __pyx_t_9;
7559 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7568 __pyx_r = __pyx_v_f;
7581 __Pyx_XDECREF(__pyx_t_1);
7582 __Pyx_XDECREF(__pyx_t_3);
7583 __Pyx_XDECREF(__pyx_t_4);
7584 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7587 __Pyx_XDECREF((PyObject *)__pyx_v_child);
7588 __Pyx_XDECREF(__pyx_v_fields);
7589 __Pyx_XDECREF(__pyx_v_childname);
7590 __Pyx_XDECREF(__pyx_v_new_offset);
7591 __Pyx_XDECREF(__pyx_v_t);
7592 __Pyx_RefNannyFinishContext();
7604 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7605 PyObject *__pyx_v_baseptr;
7606 __Pyx_RefNannyDeclarations
7609 __Pyx_RefNannySetupContext(
"set_array_base", 0);
7618 __pyx_t_1 = (__pyx_v_base == Py_None);
7619 __pyx_t_2 = (__pyx_t_1 != 0);
7629 __pyx_v_baseptr = NULL;
7649 Py_INCREF(__pyx_v_base);
7658 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
7669 Py_XDECREF(__pyx_v_arr->base);
7678 __pyx_v_arr->base = __pyx_v_baseptr;
7689 __Pyx_RefNannyFinishContext();
7700 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7701 PyObject *__pyx_r = NULL;
7702 __Pyx_RefNannyDeclarations
7704 __Pyx_RefNannySetupContext(
"get_array_base", 0);
7713 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
7723 __Pyx_XDECREF(__pyx_r);
7724 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7744 __Pyx_XDECREF(__pyx_r);
7745 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
7746 __pyx_r = ((PyObject *)__pyx_v_arr->base);
7760 __Pyx_XGIVEREF(__pyx_r);
7761 __Pyx_RefNannyFinishContext();
7773 static CYTHON_INLINE
int __pyx_f_5numpy_import_array(
void) {
7775 __Pyx_RefNannyDeclarations
7776 PyObject *__pyx_t_1 = NULL;
7777 PyObject *__pyx_t_2 = NULL;
7778 PyObject *__pyx_t_3 = NULL;
7780 PyObject *__pyx_t_5 = NULL;
7781 PyObject *__pyx_t_6 = NULL;
7782 PyObject *__pyx_t_7 = NULL;
7783 PyObject *__pyx_t_8 = NULL;
7784 __Pyx_RefNannySetupContext(
"import_array", 0);
7794 __Pyx_PyThreadState_declare
7795 __Pyx_PyThreadState_assign
7796 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7797 __Pyx_XGOTREF(__pyx_t_1);
7798 __Pyx_XGOTREF(__pyx_t_2);
7799 __Pyx_XGOTREF(__pyx_t_3);
7809 __pyx_t_4 = _import_array();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 998, __pyx_L3_error)
7819 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7820 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7821 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7822 goto __pyx_L8_try_end;
7832 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7834 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7835 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 999, __pyx_L5_except_error)
7836 __Pyx_GOTREF(__pyx_t_5);
7837 __Pyx_GOTREF(__pyx_t_6);
7838 __Pyx_GOTREF(__pyx_t_7);
7847 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1000, __pyx_L5_except_error)
7848 __Pyx_GOTREF(__pyx_t_8);
7849 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7850 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7851 __PYX_ERR(3, 1000, __pyx_L5_except_error)
7853 goto __pyx_L5_except_error;
7854 __pyx_L5_except_error:;
7863 __Pyx_XGIVEREF(__pyx_t_1);
7864 __Pyx_XGIVEREF(__pyx_t_2);
7865 __Pyx_XGIVEREF(__pyx_t_3);
7866 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7867 goto __pyx_L1_error;
7883 __Pyx_XDECREF(__pyx_t_5);
7884 __Pyx_XDECREF(__pyx_t_6);
7885 __Pyx_XDECREF(__pyx_t_7);
7886 __Pyx_XDECREF(__pyx_t_8);
7887 __Pyx_AddTraceback(
"numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7890 __Pyx_RefNannyFinishContext();
7902 static CYTHON_INLINE
int __pyx_f_5numpy_import_umath(
void) {
7904 __Pyx_RefNannyDeclarations
7905 PyObject *__pyx_t_1 = NULL;
7906 PyObject *__pyx_t_2 = NULL;
7907 PyObject *__pyx_t_3 = NULL;
7909 PyObject *__pyx_t_5 = NULL;
7910 PyObject *__pyx_t_6 = NULL;
7911 PyObject *__pyx_t_7 = NULL;
7912 PyObject *__pyx_t_8 = NULL;
7913 __Pyx_RefNannySetupContext(
"import_umath", 0);
7923 __Pyx_PyThreadState_declare
7924 __Pyx_PyThreadState_assign
7925 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7926 __Pyx_XGOTREF(__pyx_t_1);
7927 __Pyx_XGOTREF(__pyx_t_2);
7928 __Pyx_XGOTREF(__pyx_t_3);
7938 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1004, __pyx_L3_error)
7948 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7949 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7950 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7951 goto __pyx_L8_try_end;
7961 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7963 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7964 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1005, __pyx_L5_except_error)
7965 __Pyx_GOTREF(__pyx_t_5);
7966 __Pyx_GOTREF(__pyx_t_6);
7967 __Pyx_GOTREF(__pyx_t_7);
7976 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1006, __pyx_L5_except_error)
7977 __Pyx_GOTREF(__pyx_t_8);
7978 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7979 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7980 __PYX_ERR(3, 1006, __pyx_L5_except_error)
7982 goto __pyx_L5_except_error;
7983 __pyx_L5_except_error:;
7992 __Pyx_XGIVEREF(__pyx_t_1);
7993 __Pyx_XGIVEREF(__pyx_t_2);
7994 __Pyx_XGIVEREF(__pyx_t_3);
7995 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7996 goto __pyx_L1_error;
8012 __Pyx_XDECREF(__pyx_t_5);
8013 __Pyx_XDECREF(__pyx_t_6);
8014 __Pyx_XDECREF(__pyx_t_7);
8015 __Pyx_XDECREF(__pyx_t_8);
8016 __Pyx_AddTraceback(
"numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
8019 __Pyx_RefNannyFinishContext();
8031 static CYTHON_INLINE
int __pyx_f_5numpy_import_ufunc(
void) {
8033 __Pyx_RefNannyDeclarations
8034 PyObject *__pyx_t_1 = NULL;
8035 PyObject *__pyx_t_2 = NULL;
8036 PyObject *__pyx_t_3 = NULL;
8038 PyObject *__pyx_t_5 = NULL;
8039 PyObject *__pyx_t_6 = NULL;
8040 PyObject *__pyx_t_7 = NULL;
8041 PyObject *__pyx_t_8 = NULL;
8042 __Pyx_RefNannySetupContext(
"import_ufunc", 0);
8052 __Pyx_PyThreadState_declare
8053 __Pyx_PyThreadState_assign
8054 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
8055 __Pyx_XGOTREF(__pyx_t_1);
8056 __Pyx_XGOTREF(__pyx_t_2);
8057 __Pyx_XGOTREF(__pyx_t_3);
8067 __pyx_t_4 = _import_umath();
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(3, 1010, __pyx_L3_error)
8077 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8078 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8079 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8080 goto __pyx_L8_try_end;
8089 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
8091 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8092 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1011, __pyx_L5_except_error)
8093 __Pyx_GOTREF(__pyx_t_5);
8094 __Pyx_GOTREF(__pyx_t_6);
8095 __Pyx_GOTREF(__pyx_t_7);
8102 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1012, __pyx_L5_except_error)
8103 __Pyx_GOTREF(__pyx_t_8);
8104 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
8105 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8106 __PYX_ERR(3, 1012, __pyx_L5_except_error)
8108 goto __pyx_L5_except_error;
8109 __pyx_L5_except_error:;
8118 __Pyx_XGIVEREF(__pyx_t_1);
8119 __Pyx_XGIVEREF(__pyx_t_2);
8120 __Pyx_XGIVEREF(__pyx_t_3);
8121 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
8122 goto __pyx_L1_error;
8138 __Pyx_XDECREF(__pyx_t_5);
8139 __Pyx_XDECREF(__pyx_t_6);
8140 __Pyx_XDECREF(__pyx_t_7);
8141 __Pyx_XDECREF(__pyx_t_8);
8142 __Pyx_AddTraceback(
"numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
8145 __Pyx_RefNannyFinishContext();
8158 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8159 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8160 PyObject *__pyx_v_shape = 0;
8161 Py_ssize_t __pyx_v_itemsize;
8162 PyObject *__pyx_v_format = 0;
8163 PyObject *__pyx_v_mode = 0;
8164 int __pyx_v_allocate_buffer;
8166 __Pyx_RefNannyDeclarations
8167 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
8169 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
8170 PyObject* values[5] = {0,0,0,0,0};
8171 values[3] = ((PyObject *)__pyx_n_s_c);
8172 if (unlikely(__pyx_kwds)) {
8174 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8176 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8178 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8180 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8182 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8184 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8187 default:
goto __pyx_L5_argtuple_error;
8189 kw_args = PyDict_Size(__pyx_kwds);
8192 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
8193 else goto __pyx_L5_argtuple_error;
8196 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
8198 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 121, __pyx_L3_error)
8202 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
8204 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 121, __pyx_L3_error)
8209 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
8210 if (value) { values[3] = value; kw_args--; }
8215 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
8216 if (value) { values[4] = value; kw_args--; }
8219 if (unlikely(kw_args > 0)) {
8220 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 121, __pyx_L3_error)
8223 switch (PyTuple_GET_SIZE(__pyx_args)) {
8224 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8226 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8228 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8229 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8230 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8232 default:
goto __pyx_L5_argtuple_error;
8235 __pyx_v_shape = ((PyObject*)values[0]);
8236 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
8237 __pyx_v_format = values[2];
8238 __pyx_v_mode = values[3];
8240 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
8250 __pyx_v_allocate_buffer = ((int)1);
8253 goto __pyx_L4_argument_unpacking_done;
8254 __pyx_L5_argtuple_error:;
8255 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 121, __pyx_L3_error)
8257 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8258 __Pyx_RefNannyFinishContext();
8260 __pyx_L4_argument_unpacking_done:;
8261 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 121, __pyx_L1_error)
8262 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
8263 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 121, __pyx_L1_error)
8265 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
8280 __Pyx_RefNannyFinishContext();
8284 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
8286 Py_ssize_t __pyx_v_i;
8287 Py_ssize_t __pyx_v_dim;
8288 PyObject **__pyx_v_p;
8291 __Pyx_RefNannyDeclarations
8292 Py_ssize_t __pyx_t_1;
8294 PyObject *__pyx_t_3 = NULL;
8296 PyObject *__pyx_t_5 = NULL;
8299 Py_ssize_t __pyx_t_8;
8300 PyObject *__pyx_t_9 = NULL;
8301 PyObject *__pyx_t_10 = NULL;
8302 Py_ssize_t __pyx_t_11;
8303 __Pyx_RefNannySetupContext(
"__cinit__", 0);
8304 __Pyx_INCREF(__pyx_v_format);
8313 if (unlikely(__pyx_v_shape == Py_None)) {
8314 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
8315 __PYX_ERR(1, 128, __pyx_L1_error)
8317 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 128, __pyx_L1_error)
8318 __pyx_v_self->ndim = ((int)__pyx_t_1);
8327 __pyx_v_self->itemsize = __pyx_v_itemsize;
8336 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8337 if (unlikely(__pyx_t_2)) {
8346 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 132, __pyx_L1_error)
8347 __Pyx_GOTREF(__pyx_t_3);
8348 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8349 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8350 __PYX_ERR(1, 132, __pyx_L1_error)
8368 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8369 if (unlikely(__pyx_t_2)) {
8378 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
8379 __Pyx_GOTREF(__pyx_t_3);
8380 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8381 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8382 __PYX_ERR(1, 135, __pyx_L1_error)
8400 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8401 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8411 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 138, __pyx_L1_error)
8412 __Pyx_GOTREF(__pyx_t_3);
8413 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
8414 __Pyx_GOTREF(__pyx_t_5);
8415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8416 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
8435 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 139, __pyx_L1_error)
8436 __pyx_t_5 = __pyx_v_format;
8437 __Pyx_INCREF(__pyx_t_5);
8438 __Pyx_GIVEREF(__pyx_t_5);
8439 __Pyx_GOTREF(__pyx_v_self->_format);
8440 __Pyx_DECREF(__pyx_v_self->_format);
8441 __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
8451 if (unlikely(__pyx_v_self->_format == Py_None)) {
8452 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
8453 __PYX_ERR(1, 140, __pyx_L1_error)
8455 __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 140, __pyx_L1_error)
8456 __pyx_v_self->format = __pyx_t_6;
8465 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8474 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8483 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8484 if (unlikely(__pyx_t_4)) {
8493 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
8494 __Pyx_GOTREF(__pyx_t_5);
8495 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
8496 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8497 __PYX_ERR(1, 147, __pyx_L1_error)
8516 __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
8518 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5))
break;
8519 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8520 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
8522 __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 150, __pyx_L1_error)
8523 __Pyx_GOTREF(__pyx_t_3);
8525 __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
8526 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8527 __pyx_v_dim = __pyx_t_8;
8528 __pyx_v_idx = __pyx_t_7;
8529 __pyx_t_7 = (__pyx_t_7 + 1);
8538 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8539 if (unlikely(__pyx_t_4)) {
8548 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 152, __pyx_L1_error)
8549 __Pyx_GOTREF(__pyx_t_3);
8550 __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8551 __Pyx_GOTREF(__pyx_t_9);
8552 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8553 __Pyx_GOTREF(__pyx_t_10);
8554 __Pyx_GIVEREF(__pyx_t_3);
8555 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
8556 __Pyx_GIVEREF(__pyx_t_9);
8557 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
8560 __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
8561 __Pyx_GOTREF(__pyx_t_9);
8562 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8563 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
8564 __Pyx_GOTREF(__pyx_t_10);
8565 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8566 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8567 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8568 __PYX_ERR(1, 152, __pyx_L1_error)
8586 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8596 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8605 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
8615 __pyx_v_order =
'F';
8624 __Pyx_INCREF(__pyx_n_u_fortran);
8625 __Pyx_GIVEREF(__pyx_n_u_fortran);
8626 __Pyx_GOTREF(__pyx_v_self->mode);
8627 __Pyx_DECREF(__pyx_v_self->mode);
8628 __pyx_v_self->mode = __pyx_n_u_fortran;
8647 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 159, __pyx_L1_error)
8648 if (likely(__pyx_t_4)) {
8657 __pyx_v_order =
'C';
8666 __Pyx_INCREF(__pyx_n_u_c);
8667 __Pyx_GIVEREF(__pyx_n_u_c);
8668 __Pyx_GOTREF(__pyx_v_self->mode);
8669 __Pyx_DECREF(__pyx_v_self->mode);
8670 __pyx_v_self->mode = __pyx_n_u_c;
8690 __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 163, __pyx_L1_error)
8691 __Pyx_GOTREF(__pyx_t_5);
8692 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 163, __pyx_L1_error)
8693 __Pyx_GOTREF(__pyx_t_10);
8694 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8695 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8696 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8697 __PYX_ERR(1, 163, __pyx_L1_error)
8708 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8717 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8726 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 169, __pyx_L1_error)
8727 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 169, __pyx_L1_error)
8728 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8729 __pyx_v_self->dtype_is_object = __pyx_t_4;
8738 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8748 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
8757 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8758 if (unlikely(__pyx_t_4)) {
8767 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 175, __pyx_L1_error)
8768 __Pyx_GOTREF(__pyx_t_10);
8769 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8770 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8771 __PYX_ERR(1, 175, __pyx_L1_error)
8789 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8799 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8808 if (unlikely(__pyx_v_itemsize == 0)) {
8809 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
8810 __PYX_ERR(1, 179, __pyx_L1_error)
8812 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8813 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
8814 __PYX_ERR(1, 179, __pyx_L1_error)
8816 __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8817 __pyx_t_8 = __pyx_t_1;
8818 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
8819 __pyx_v_i = __pyx_t_11;
8828 (__pyx_v_p[__pyx_v_i]) = Py_None;
8870 __Pyx_XDECREF(__pyx_t_3);
8871 __Pyx_XDECREF(__pyx_t_5);
8872 __Pyx_XDECREF(__pyx_t_9);
8873 __Pyx_XDECREF(__pyx_t_10);
8874 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8877 __Pyx_XDECREF(__pyx_v_format);
8878 __Pyx_RefNannyFinishContext();
8891 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
8892 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8894 __Pyx_RefNannyDeclarations
8895 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
8896 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
8899 __Pyx_RefNannyFinishContext();
8903 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
8904 int __pyx_v_bufmode;
8906 __Pyx_RefNannyDeclarations
8909 PyObject *__pyx_t_3 = NULL;
8911 Py_ssize_t __pyx_t_5;
8913 Py_ssize_t *__pyx_t_7;
8914 if (__pyx_v_info == NULL) {
8915 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
8918 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
8919 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8920 __Pyx_GIVEREF(__pyx_v_info->obj);
8929 __pyx_v_bufmode = -1;
8938 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 186, __pyx_L1_error)
8939 __pyx_t_2 = (__pyx_t_1 != 0);
8949 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8968 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
8969 __pyx_t_1 = (__pyx_t_2 != 0);
8979 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8998 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8999 if (unlikely(__pyx_t_1)) {
9008 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
9009 __Pyx_GOTREF(__pyx_t_3);
9010 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9011 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9012 __PYX_ERR(1, 191, __pyx_L1_error)
9030 __pyx_t_4 = __pyx_v_self->data;
9031 __pyx_v_info->buf = __pyx_t_4;
9040 __pyx_t_5 = __pyx_v_self->len;
9041 __pyx_v_info->len = __pyx_t_5;
9050 __pyx_t_6 = __pyx_v_self->ndim;
9051 __pyx_v_info->ndim = __pyx_t_6;
9060 __pyx_t_7 = __pyx_v_self->_shape;
9061 __pyx_v_info->shape = __pyx_t_7;
9070 __pyx_t_7 = __pyx_v_self->_strides;
9071 __pyx_v_info->strides = __pyx_t_7;
9080 __pyx_v_info->suboffsets = NULL;
9089 __pyx_t_5 = __pyx_v_self->itemsize;
9090 __pyx_v_info->itemsize = __pyx_t_5;
9099 __pyx_v_info->readonly = 0;
9108 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9118 __pyx_t_4 = __pyx_v_self->format;
9119 __pyx_v_info->format = __pyx_t_4;
9139 __pyx_v_info->format = NULL;
9150 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9151 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9152 __Pyx_GOTREF(__pyx_v_info->obj);
9153 __Pyx_DECREF(__pyx_v_info->obj);
9154 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
9168 __Pyx_XDECREF(__pyx_t_3);
9169 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9171 if (__pyx_v_info->obj != NULL) {
9172 __Pyx_GOTREF(__pyx_v_info->obj);
9173 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9177 if (__pyx_v_info->obj == Py_None) {
9178 __Pyx_GOTREF(__pyx_v_info->obj);
9179 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
9182 __Pyx_RefNannyFinishContext();
9195 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
9196 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
9197 __Pyx_RefNannyDeclarations
9198 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9199 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
9202 __Pyx_RefNannyFinishContext();
9205 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
9206 __Pyx_RefNannyDeclarations
9208 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9217 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
9227 __pyx_v_self->callback_free_data(__pyx_v_self->data);
9246 __pyx_t_1 = (__pyx_v_self->free_data != 0);
9256 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
9266 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
9284 free(__pyx_v_self->data);
9303 PyObject_Free(__pyx_v_self->_shape);
9314 __Pyx_RefNannyFinishContext();
9326 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
9327 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9328 PyObject *__pyx_r = 0;
9329 __Pyx_RefNannyDeclarations
9330 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
9331 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
9334 __Pyx_RefNannyFinishContext();
9338 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
9339 PyObject *__pyx_r = NULL;
9340 __Pyx_RefNannyDeclarations
9341 PyObject *__pyx_t_1 = NULL;
9342 __Pyx_RefNannySetupContext(
"__get__", 0);
9351 __Pyx_XDECREF(__pyx_r);
9352 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
9353 __Pyx_GOTREF(__pyx_t_1);
9354 __pyx_r = __pyx_t_1;
9368 __Pyx_XDECREF(__pyx_t_1);
9369 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9372 __Pyx_XGIVEREF(__pyx_r);
9373 __Pyx_RefNannyFinishContext();
9385 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
9387 PyObject *__pyx_r = NULL;
9388 __Pyx_RefNannyDeclarations
9389 PyObject *__pyx_t_1 = NULL;
9390 PyObject *__pyx_t_2 = NULL;
9391 PyObject *__pyx_t_3 = NULL;
9392 __Pyx_RefNannySetupContext(
"get_memview", 0);
9401 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9410 __Pyx_XDECREF(__pyx_r);
9411 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 227, __pyx_L1_error)
9412 __Pyx_GOTREF(__pyx_t_1);
9413 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9414 __Pyx_GOTREF(__pyx_t_2);
9415 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 227, __pyx_L1_error)
9416 __Pyx_GOTREF(__pyx_t_3);
9417 __Pyx_INCREF(((PyObject *)__pyx_v_self));
9418 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9419 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9420 __Pyx_GIVEREF(__pyx_t_1);
9421 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9422 __Pyx_GIVEREF(__pyx_t_2);
9423 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9426 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 227, __pyx_L1_error)
9427 __Pyx_GOTREF(__pyx_t_2);
9428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9429 __pyx_r = __pyx_t_2;
9443 __Pyx_XDECREF(__pyx_t_1);
9444 __Pyx_XDECREF(__pyx_t_2);
9445 __Pyx_XDECREF(__pyx_t_3);
9446 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9449 __Pyx_XGIVEREF(__pyx_r);
9450 __Pyx_RefNannyFinishContext();
9463 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
9464 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9466 __Pyx_RefNannyDeclarations
9467 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
9468 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
9471 __Pyx_RefNannyFinishContext();
9475 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
9477 __Pyx_RefNannyDeclarations
9478 __Pyx_RefNannySetupContext(
"__len__", 0);
9487 __pyx_r = (__pyx_v_self->_shape[0]);
9500 __Pyx_RefNannyFinishContext();
9513 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
9514 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9515 PyObject *__pyx_r = 0;
9516 __Pyx_RefNannyDeclarations
9517 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
9518 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9521 __Pyx_RefNannyFinishContext();
9525 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9526 PyObject *__pyx_r = NULL;
9527 __Pyx_RefNannyDeclarations
9528 PyObject *__pyx_t_1 = NULL;
9529 PyObject *__pyx_t_2 = NULL;
9530 __Pyx_RefNannySetupContext(
"__getattr__", 0);
9539 __Pyx_XDECREF(__pyx_r);
9540 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __pyx_L1_error)
9541 __Pyx_GOTREF(__pyx_t_1);
9542 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __pyx_L1_error)
9543 __Pyx_GOTREF(__pyx_t_2);
9544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9545 __pyx_r = __pyx_t_2;
9559 __Pyx_XDECREF(__pyx_t_1);
9560 __Pyx_XDECREF(__pyx_t_2);
9561 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9564 __Pyx_XGIVEREF(__pyx_r);
9565 __Pyx_RefNannyFinishContext();
9578 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
9579 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9580 PyObject *__pyx_r = 0;
9581 __Pyx_RefNannyDeclarations
9582 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
9583 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9586 __Pyx_RefNannyFinishContext();
9590 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9591 PyObject *__pyx_r = NULL;
9592 __Pyx_RefNannyDeclarations
9593 PyObject *__pyx_t_1 = NULL;
9594 PyObject *__pyx_t_2 = NULL;
9595 __Pyx_RefNannySetupContext(
"__getitem__", 0);
9604 __Pyx_XDECREF(__pyx_r);
9605 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
9606 __Pyx_GOTREF(__pyx_t_1);
9607 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
9608 __Pyx_GOTREF(__pyx_t_2);
9609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9610 __pyx_r = __pyx_t_2;
9624 __Pyx_XDECREF(__pyx_t_1);
9625 __Pyx_XDECREF(__pyx_t_2);
9626 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9629 __Pyx_XGIVEREF(__pyx_r);
9630 __Pyx_RefNannyFinishContext();
9643 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
9644 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9646 __Pyx_RefNannyDeclarations
9647 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
9648 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9651 __Pyx_RefNannyFinishContext();
9655 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9657 __Pyx_RefNannyDeclarations
9658 PyObject *__pyx_t_1 = NULL;
9659 __Pyx_RefNannySetupContext(
"__setitem__", 0);
9668 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
9669 __Pyx_GOTREF(__pyx_t_1);
9670 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 239, __pyx_L1_error)
9671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9685 __Pyx_XDECREF(__pyx_t_1);
9686 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9689 __Pyx_RefNannyFinishContext();
9700 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
9701 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9702 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9703 PyObject *__pyx_r = 0;
9704 __Pyx_RefNannyDeclarations
9705 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
9706 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
9709 __Pyx_RefNannyFinishContext();
9713 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
9714 PyObject *__pyx_r = NULL;
9715 __Pyx_RefNannyDeclarations
9716 PyObject *__pyx_t_1 = NULL;
9717 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
9725 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9726 __Pyx_GOTREF(__pyx_t_1);
9727 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9728 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9729 __PYX_ERR(1, 2, __pyx_L1_error)
9739 __Pyx_XDECREF(__pyx_t_1);
9740 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9742 __Pyx_XGIVEREF(__pyx_r);
9743 __Pyx_RefNannyFinishContext();
9755 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9756 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9757 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9758 PyObject *__pyx_r = 0;
9759 __Pyx_RefNannyDeclarations
9760 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9761 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9764 __Pyx_RefNannyFinishContext();
9768 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9769 PyObject *__pyx_r = NULL;
9770 __Pyx_RefNannyDeclarations
9771 PyObject *__pyx_t_1 = NULL;
9772 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9779 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9780 __Pyx_GOTREF(__pyx_t_1);
9781 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9783 __PYX_ERR(1, 4, __pyx_L1_error)
9794 __Pyx_XDECREF(__pyx_t_1);
9795 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9797 __Pyx_XGIVEREF(__pyx_r);
9798 __Pyx_RefNannyFinishContext();
9810 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
9811 struct __pyx_array_obj *__pyx_v_result = 0;
9812 struct __pyx_array_obj *__pyx_r = NULL;
9813 __Pyx_RefNannyDeclarations
9815 PyObject *__pyx_t_2 = NULL;
9816 PyObject *__pyx_t_3 = NULL;
9817 PyObject *__pyx_t_4 = NULL;
9818 PyObject *__pyx_t_5 = NULL;
9819 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
9828 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9838 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
9839 __Pyx_GOTREF(__pyx_t_2);
9840 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
9841 __Pyx_GOTREF(__pyx_t_3);
9842 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
9843 __Pyx_GOTREF(__pyx_t_4);
9844 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
9845 __Pyx_GOTREF(__pyx_t_5);
9846 __Pyx_INCREF(__pyx_v_shape);
9847 __Pyx_GIVEREF(__pyx_v_shape);
9848 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9849 __Pyx_GIVEREF(__pyx_t_2);
9850 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9851 __Pyx_GIVEREF(__pyx_t_3);
9852 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9853 __Pyx_GIVEREF(__pyx_t_4);
9854 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9858 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 248, __pyx_L1_error)
9859 __Pyx_GOTREF(__pyx_t_4);
9860 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9861 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
9882 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
9883 __Pyx_GOTREF(__pyx_t_4);
9884 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
9885 __Pyx_GOTREF(__pyx_t_5);
9886 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
9887 __Pyx_GOTREF(__pyx_t_3);
9888 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
9889 __Pyx_GOTREF(__pyx_t_2);
9890 __Pyx_INCREF(__pyx_v_shape);
9891 __Pyx_GIVEREF(__pyx_v_shape);
9892 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9893 __Pyx_GIVEREF(__pyx_t_4);
9894 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9895 __Pyx_GIVEREF(__pyx_t_5);
9896 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9897 __Pyx_GIVEREF(__pyx_t_3);
9898 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9910 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
9911 __Pyx_GOTREF(__pyx_t_3);
9912 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 251, __pyx_L1_error)
9921 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
9922 __Pyx_GOTREF(__pyx_t_5);
9923 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9924 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9925 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
9935 __pyx_v_result->data = __pyx_v_buf;
9946 __Pyx_XDECREF(((PyObject *)__pyx_r));
9947 __Pyx_INCREF(((PyObject *)__pyx_v_result));
9948 __pyx_r = __pyx_v_result;
9961 __Pyx_XDECREF(__pyx_t_2);
9962 __Pyx_XDECREF(__pyx_t_3);
9963 __Pyx_XDECREF(__pyx_t_4);
9964 __Pyx_XDECREF(__pyx_t_5);
9965 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9968 __Pyx_XDECREF((PyObject *)__pyx_v_result);
9969 __Pyx_XGIVEREF((PyObject *)__pyx_r);
9970 __Pyx_RefNannyFinishContext();
9983 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9984 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9985 PyObject *__pyx_v_name = 0;
9987 __Pyx_RefNannyDeclarations
9988 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
9990 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9991 PyObject* values[1] = {0};
9992 if (unlikely(__pyx_kwds)) {
9994 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9996 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9999 default:
goto __pyx_L5_argtuple_error;
10001 kw_args = PyDict_Size(__pyx_kwds);
10002 switch (pos_args) {
10004 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
10005 else goto __pyx_L5_argtuple_error;
10007 if (unlikely(kw_args > 0)) {
10008 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 280, __pyx_L3_error)
10010 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
10011 goto __pyx_L5_argtuple_error;
10013 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10015 __pyx_v_name = values[0];
10017 goto __pyx_L4_argument_unpacking_done;
10018 __pyx_L5_argtuple_error:;
10019 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 280, __pyx_L3_error)
10021 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10022 __Pyx_RefNannyFinishContext();
10024 __pyx_L4_argument_unpacking_done:;
10025 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
10028 __Pyx_RefNannyFinishContext();
10032 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
10034 __Pyx_RefNannyDeclarations
10035 __Pyx_RefNannySetupContext(
"__init__", 0);
10044 __Pyx_INCREF(__pyx_v_name);
10045 __Pyx_GIVEREF(__pyx_v_name);
10046 __Pyx_GOTREF(__pyx_v_self->name);
10047 __Pyx_DECREF(__pyx_v_self->name);
10048 __pyx_v_self->name = __pyx_v_name;
10060 __Pyx_RefNannyFinishContext();
10073 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
10074 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
10075 PyObject *__pyx_r = 0;
10076 __Pyx_RefNannyDeclarations
10077 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
10078 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10081 __Pyx_RefNannyFinishContext();
10085 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10086 PyObject *__pyx_r = NULL;
10087 __Pyx_RefNannyDeclarations
10088 __Pyx_RefNannySetupContext(
"__repr__", 0);
10097 __Pyx_XDECREF(__pyx_r);
10098 __Pyx_INCREF(__pyx_v_self->name);
10099 __pyx_r = __pyx_v_self->name;
10112 __Pyx_XGIVEREF(__pyx_r);
10113 __Pyx_RefNannyFinishContext();
10124 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
10125 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
10126 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10127 PyObject *__pyx_r = 0;
10128 __Pyx_RefNannyDeclarations
10129 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
10130 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
10133 __Pyx_RefNannyFinishContext();
10137 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
10138 int __pyx_v_use_setstate;
10139 PyObject *__pyx_v_state = NULL;
10140 PyObject *__pyx_v__dict = NULL;
10141 PyObject *__pyx_r = NULL;
10142 __Pyx_RefNannyDeclarations
10143 PyObject *__pyx_t_1 = NULL;
10146 PyObject *__pyx_t_4 = NULL;
10147 PyObject *__pyx_t_5 = NULL;
10148 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
10157 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
10158 __Pyx_GOTREF(__pyx_t_1);
10159 __Pyx_INCREF(__pyx_v_self->name);
10160 __Pyx_GIVEREF(__pyx_v_self->name);
10161 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
10162 __pyx_v_state = ((PyObject*)__pyx_t_1);
10172 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
10173 __Pyx_GOTREF(__pyx_t_1);
10174 __pyx_v__dict = __pyx_t_1;
10184 __pyx_t_2 = (__pyx_v__dict != Py_None);
10185 __pyx_t_3 = (__pyx_t_2 != 0);
10195 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
10196 __Pyx_GOTREF(__pyx_t_1);
10197 __Pyx_INCREF(__pyx_v__dict);
10198 __Pyx_GIVEREF(__pyx_v__dict);
10199 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
10200 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
10201 __Pyx_GOTREF(__pyx_t_4);
10202 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10203 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
10213 __pyx_v_use_setstate = 1;
10233 __pyx_t_3 = (__pyx_v_self->name != Py_None);
10234 __pyx_v_use_setstate = __pyx_t_3;
10245 __pyx_t_3 = (__pyx_v_use_setstate != 0);
10255 __Pyx_XDECREF(__pyx_r);
10256 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
10257 __Pyx_GOTREF(__pyx_t_4);
10258 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
10259 __Pyx_GOTREF(__pyx_t_1);
10260 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10261 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10262 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10263 __Pyx_INCREF(__pyx_int_184977713);
10264 __Pyx_GIVEREF(__pyx_int_184977713);
10265 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10266 __Pyx_INCREF(Py_None);
10267 __Pyx_GIVEREF(Py_None);
10268 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
10269 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
10270 __Pyx_GOTREF(__pyx_t_5);
10271 __Pyx_GIVEREF(__pyx_t_4);
10272 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
10273 __Pyx_GIVEREF(__pyx_t_1);
10274 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
10275 __Pyx_INCREF(__pyx_v_state);
10276 __Pyx_GIVEREF(__pyx_v_state);
10277 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
10280 __pyx_r = __pyx_t_5;
10301 __Pyx_XDECREF(__pyx_r);
10302 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
10303 __Pyx_GOTREF(__pyx_t_5);
10304 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
10305 __Pyx_GOTREF(__pyx_t_1);
10306 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10307 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10308 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10309 __Pyx_INCREF(__pyx_int_184977713);
10310 __Pyx_GIVEREF(__pyx_int_184977713);
10311 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10312 __Pyx_INCREF(__pyx_v_state);
10313 __Pyx_GIVEREF(__pyx_v_state);
10314 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10315 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
10316 __Pyx_GOTREF(__pyx_t_4);
10317 __Pyx_GIVEREF(__pyx_t_5);
10318 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10319 __Pyx_GIVEREF(__pyx_t_1);
10320 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10323 __pyx_r = __pyx_t_4;
10336 __Pyx_XDECREF(__pyx_t_1);
10337 __Pyx_XDECREF(__pyx_t_4);
10338 __Pyx_XDECREF(__pyx_t_5);
10339 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10342 __Pyx_XDECREF(__pyx_v_state);
10343 __Pyx_XDECREF(__pyx_v__dict);
10344 __Pyx_XGIVEREF(__pyx_r);
10345 __Pyx_RefNannyFinishContext();
10357 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
10358 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10359 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10360 PyObject *__pyx_r = 0;
10361 __Pyx_RefNannyDeclarations
10362 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
10363 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10366 __Pyx_RefNannyFinishContext();
10370 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10371 PyObject *__pyx_r = NULL;
10372 __Pyx_RefNannyDeclarations
10373 PyObject *__pyx_t_1 = NULL;
10374 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
10381 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
10382 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
10383 __Pyx_GOTREF(__pyx_t_1);
10384 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10394 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10397 __Pyx_XDECREF(__pyx_t_1);
10398 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10401 __Pyx_XGIVEREF(__pyx_r);
10402 __Pyx_RefNannyFinishContext();
10414 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
10415 Py_intptr_t __pyx_v_aligned_p;
10416 size_t __pyx_v_offset;
10427 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10436 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10445 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10455 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10473 __pyx_r = ((
void *)__pyx_v_aligned_p);
10498 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10499 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10500 PyObject *__pyx_v_obj = 0;
10502 int __pyx_v_dtype_is_object;
10504 __Pyx_RefNannyDeclarations
10505 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
10507 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10508 PyObject* values[3] = {0,0,0};
10509 if (unlikely(__pyx_kwds)) {
10510 Py_ssize_t kw_args;
10511 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10512 switch (pos_args) {
10513 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10514 CYTHON_FALLTHROUGH;
10515 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10516 CYTHON_FALLTHROUGH;
10517 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10518 CYTHON_FALLTHROUGH;
10520 default:
goto __pyx_L5_argtuple_error;
10522 kw_args = PyDict_Size(__pyx_kwds);
10523 switch (pos_args) {
10525 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10526 else goto __pyx_L5_argtuple_error;
10527 CYTHON_FALLTHROUGH;
10529 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10531 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
10533 CYTHON_FALLTHROUGH;
10536 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10537 if (value) { values[2] = value; kw_args--; }
10540 if (unlikely(kw_args > 0)) {
10541 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 344, __pyx_L3_error)
10544 switch (PyTuple_GET_SIZE(__pyx_args)) {
10545 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10546 CYTHON_FALLTHROUGH;
10547 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10548 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10550 default:
goto __pyx_L5_argtuple_error;
10553 __pyx_v_obj = values[0];
10554 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10556 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 344, __pyx_L3_error)
10558 __pyx_v_dtype_is_object = ((int)0);
10561 goto __pyx_L4_argument_unpacking_done;
10562 __pyx_L5_argtuple_error:;
10563 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
10565 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10566 __Pyx_RefNannyFinishContext();
10568 __pyx_L4_argument_unpacking_done:;
10569 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10572 __Pyx_RefNannyFinishContext();
10576 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
10578 __Pyx_RefNannyDeclarations
10583 __Pyx_RefNannySetupContext(
"__cinit__", 0);
10592 __Pyx_INCREF(__pyx_v_obj);
10593 __Pyx_GIVEREF(__pyx_v_obj);
10594 __Pyx_GOTREF(__pyx_v_self->obj);
10595 __Pyx_DECREF(__pyx_v_self->obj);
10596 __pyx_v_self->obj = __pyx_v_obj;
10605 __pyx_v_self->flags = __pyx_v_flags;
10614 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10615 __pyx_t_3 = (__pyx_t_2 != 0);
10618 __pyx_t_1 = __pyx_t_3;
10619 goto __pyx_L4_bool_binop_done;
10621 __pyx_t_3 = (__pyx_v_obj != Py_None);
10622 __pyx_t_2 = (__pyx_t_3 != 0);
10623 __pyx_t_1 = __pyx_t_2;
10624 __pyx_L4_bool_binop_done:;
10634 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 348, __pyx_L1_error)
10643 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10653 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10662 Py_INCREF(Py_None);
10689 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10699 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10708 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10726 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10736 __pyx_v_self->lock = PyThread_allocate_lock();
10745 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10746 if (unlikely(__pyx_t_1)) {
10755 PyErr_NoMemory(); __PYX_ERR(1, 360, __pyx_L1_error)
10782 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10792 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
10795 __pyx_t_1 = __pyx_t_2;
10796 goto __pyx_L11_bool_binop_done;
10798 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
10799 __pyx_t_1 = __pyx_t_2;
10800 __pyx_L11_bool_binop_done:;
10801 __pyx_v_self->dtype_is_object = __pyx_t_1;
10821 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10832 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
10841 __pyx_v_self->typeinfo = NULL;
10855 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10858 __Pyx_RefNannyFinishContext();
10871 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
10872 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10873 __Pyx_RefNannyDeclarations
10874 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
10875 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
10878 __Pyx_RefNannyFinishContext();
10881 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
10883 __Pyx_RefNannyDeclarations
10889 PyThread_type_lock __pyx_t_6;
10890 PyThread_type_lock __pyx_t_7;
10891 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
10900 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10901 __pyx_t_2 = (__pyx_t_1 != 0);
10911 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10929 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10939 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10940 __pyx_t_4 = __pyx_t_3;
10941 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10942 __pyx_v_i = __pyx_t_5;
10951 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10961 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10970 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10980 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10981 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10990 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10991 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
11009 goto __pyx_L6_break;
11029 PyThread_free_lock(__pyx_v_self->lock);
11051 __Pyx_RefNannyFinishContext();
11062 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11063 Py_ssize_t __pyx_v_dim;
11064 char *__pyx_v_itemp;
11065 PyObject *__pyx_v_idx = NULL;
11067 __Pyx_RefNannyDeclarations
11068 Py_ssize_t __pyx_t_1;
11069 PyObject *__pyx_t_2 = NULL;
11070 Py_ssize_t __pyx_t_3;
11071 PyObject *(*__pyx_t_4)(PyObject *);
11072 PyObject *__pyx_t_5 = NULL;
11073 Py_ssize_t __pyx_t_6;
11075 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
11084 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
11094 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
11095 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11098 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 392, __pyx_L1_error)
11099 __Pyx_GOTREF(__pyx_t_2);
11100 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 392, __pyx_L1_error)
11103 if (likely(!__pyx_t_4)) {
11104 if (likely(PyList_CheckExact(__pyx_t_2))) {
11105 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
11106 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11107 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11109 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11110 __Pyx_GOTREF(__pyx_t_5);
11113 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
11114 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11115 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 392, __pyx_L1_error)
11117 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 392, __pyx_L1_error)
11118 __Pyx_GOTREF(__pyx_t_5);
11122 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
11123 if (unlikely(!__pyx_t_5)) {
11124 PyObject* exc_type = PyErr_Occurred();
11126 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11127 else __PYX_ERR(1, 392, __pyx_L1_error)
11131 __Pyx_GOTREF(__pyx_t_5);
11133 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
11135 __pyx_v_dim = __pyx_t_1;
11136 __pyx_t_1 = (__pyx_t_1 + 1);
11145 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 393, __pyx_L1_error)
11146 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 393, __pyx_L1_error)
11147 __pyx_v_itemp = __pyx_t_7;
11157 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11166 __pyx_r = __pyx_v_itemp;
11179 __Pyx_XDECREF(__pyx_t_2);
11180 __Pyx_XDECREF(__pyx_t_5);
11181 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
11184 __Pyx_XDECREF(__pyx_v_idx);
11185 __Pyx_RefNannyFinishContext();
11198 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
11199 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
11200 PyObject *__pyx_r = 0;
11201 __Pyx_RefNannyDeclarations
11202 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
11203 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
11206 __Pyx_RefNannyFinishContext();
11210 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
11211 PyObject *__pyx_v_have_slices = NULL;
11212 PyObject *__pyx_v_indices = NULL;
11213 char *__pyx_v_itemp;
11214 PyObject *__pyx_r = NULL;
11215 __Pyx_RefNannyDeclarations
11218 PyObject *__pyx_t_3 = NULL;
11219 PyObject *__pyx_t_4 = NULL;
11220 PyObject *__pyx_t_5 = NULL;
11222 __Pyx_RefNannySetupContext(
"__getitem__", 0);
11231 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
11232 __pyx_t_2 = (__pyx_t_1 != 0);
11242 __Pyx_XDECREF(__pyx_r);
11243 __Pyx_INCREF(((PyObject *)__pyx_v_self));
11244 __pyx_r = ((PyObject *)__pyx_v_self);
11263 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 402, __pyx_L1_error)
11264 __Pyx_GOTREF(__pyx_t_3);
11265 if (likely(__pyx_t_3 != Py_None)) {
11266 PyObject* sequence = __pyx_t_3;
11267 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11268 if (unlikely(size != 2)) {
11269 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11270 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11271 __PYX_ERR(1, 402, __pyx_L1_error)
11273 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11274 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
11275 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
11276 __Pyx_INCREF(__pyx_t_4);
11277 __Pyx_INCREF(__pyx_t_5);
11279 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 402, __pyx_L1_error)
11280 __Pyx_GOTREF(__pyx_t_4);
11281 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 402, __pyx_L1_error)
11282 __Pyx_GOTREF(__pyx_t_5);
11284 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11286 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 402, __pyx_L1_error)
11288 __pyx_v_have_slices = __pyx_t_4;
11290 __pyx_v_indices = __pyx_t_5;
11300 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 405, __pyx_L1_error)
11310 __Pyx_XDECREF(__pyx_r);
11311 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 406, __pyx_L1_error)
11312 __Pyx_GOTREF(__pyx_t_3);
11313 __pyx_r = __pyx_t_3;
11334 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 408, __pyx_L1_error)
11335 __pyx_v_itemp = __pyx_t_6;
11344 __Pyx_XDECREF(__pyx_r);
11345 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
11346 __Pyx_GOTREF(__pyx_t_3);
11347 __pyx_r = __pyx_t_3;
11362 __Pyx_XDECREF(__pyx_t_3);
11363 __Pyx_XDECREF(__pyx_t_4);
11364 __Pyx_XDECREF(__pyx_t_5);
11365 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11368 __Pyx_XDECREF(__pyx_v_have_slices);
11369 __Pyx_XDECREF(__pyx_v_indices);
11370 __Pyx_XGIVEREF(__pyx_r);
11371 __Pyx_RefNannyFinishContext();
11384 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
11385 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11387 __Pyx_RefNannyDeclarations
11388 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
11389 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11392 __Pyx_RefNannyFinishContext();
11396 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11397 PyObject *__pyx_v_have_slices = NULL;
11398 PyObject *__pyx_v_obj = NULL;
11400 __Pyx_RefNannyDeclarations
11402 PyObject *__pyx_t_2 = NULL;
11403 PyObject *__pyx_t_3 = NULL;
11404 PyObject *__pyx_t_4 = NULL;
11405 __Pyx_RefNannySetupContext(
"__setitem__", 0);
11406 __Pyx_INCREF(__pyx_v_index);
11415 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11416 if (unlikely(__pyx_t_1)) {
11425 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
11426 __Pyx_GOTREF(__pyx_t_2);
11427 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11428 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11429 __PYX_ERR(1, 413, __pyx_L1_error)
11447 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
11448 __Pyx_GOTREF(__pyx_t_2);
11449 if (likely(__pyx_t_2 != Py_None)) {
11450 PyObject* sequence = __pyx_t_2;
11451 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11452 if (unlikely(size != 2)) {
11453 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11454 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11455 __PYX_ERR(1, 415, __pyx_L1_error)
11457 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11458 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11459 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11460 __Pyx_INCREF(__pyx_t_3);
11461 __Pyx_INCREF(__pyx_t_4);
11463 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 415, __pyx_L1_error)
11464 __Pyx_GOTREF(__pyx_t_3);
11465 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 415, __pyx_L1_error)
11466 __Pyx_GOTREF(__pyx_t_4);
11468 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11470 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 415, __pyx_L1_error)
11472 __pyx_v_have_slices = __pyx_t_3;
11474 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11484 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 417, __pyx_L1_error)
11494 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
11495 __Pyx_GOTREF(__pyx_t_2);
11496 __pyx_v_obj = __pyx_t_2;
11506 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 419, __pyx_L1_error)
11516 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
11517 __Pyx_GOTREF(__pyx_t_2);
11518 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
11519 __Pyx_GOTREF(__pyx_t_4);
11520 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11521 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11541 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
11542 __Pyx_GOTREF(__pyx_t_4);
11543 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 422, __pyx_L1_error)
11544 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
11545 __Pyx_GOTREF(__pyx_t_2);
11546 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11547 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11569 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
11570 __Pyx_GOTREF(__pyx_t_2);
11571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11587 __Pyx_XDECREF(__pyx_t_2);
11588 __Pyx_XDECREF(__pyx_t_3);
11589 __Pyx_XDECREF(__pyx_t_4);
11590 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11593 __Pyx_XDECREF(__pyx_v_have_slices);
11594 __Pyx_XDECREF(__pyx_v_obj);
11595 __Pyx_XDECREF(__pyx_v_index);
11596 __Pyx_RefNannyFinishContext();
11608 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11609 PyObject *__pyx_r = NULL;
11610 __Pyx_RefNannyDeclarations
11613 PyObject *__pyx_t_3 = NULL;
11614 PyObject *__pyx_t_4 = NULL;
11615 PyObject *__pyx_t_5 = NULL;
11616 PyObject *__pyx_t_6 = NULL;
11617 PyObject *__pyx_t_7 = NULL;
11618 PyObject *__pyx_t_8 = NULL;
11620 __Pyx_RefNannySetupContext(
"is_slice", 0);
11621 __Pyx_INCREF(__pyx_v_obj);
11630 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11631 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11642 __Pyx_PyThreadState_declare
11643 __Pyx_PyThreadState_assign
11644 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11645 __Pyx_XGOTREF(__pyx_t_3);
11646 __Pyx_XGOTREF(__pyx_t_4);
11647 __Pyx_XGOTREF(__pyx_t_5);
11657 __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 429, __pyx_L4_error)
11658 __Pyx_GOTREF(__pyx_t_6);
11667 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 430, __pyx_L4_error)
11668 __Pyx_GOTREF(__pyx_t_7);
11677 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 429, __pyx_L4_error)
11678 __Pyx_GOTREF(__pyx_t_8);
11679 __Pyx_INCREF(__pyx_v_obj);
11680 __Pyx_GIVEREF(__pyx_v_obj);
11681 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11682 __Pyx_GIVEREF(__pyx_t_6);
11683 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11684 __Pyx_GIVEREF(__pyx_t_7);
11685 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11688 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 429, __pyx_L4_error)
11689 __Pyx_GOTREF(__pyx_t_7);
11690 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11691 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11702 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11703 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11704 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11705 goto __pyx_L9_try_end;
11707 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11708 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11709 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11718 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11720 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11721 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 431, __pyx_L6_except_error)
11722 __Pyx_GOTREF(__pyx_t_7);
11723 __Pyx_GOTREF(__pyx_t_8);
11724 __Pyx_GOTREF(__pyx_t_6);
11733 __Pyx_XDECREF(__pyx_r);
11734 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11735 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11736 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11737 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11738 goto __pyx_L7_except_return;
11740 goto __pyx_L6_except_error;
11741 __pyx_L6_except_error:;
11750 __Pyx_XGIVEREF(__pyx_t_3);
11751 __Pyx_XGIVEREF(__pyx_t_4);
11752 __Pyx_XGIVEREF(__pyx_t_5);
11753 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11754 goto __pyx_L1_error;
11755 __pyx_L7_except_return:;
11756 __Pyx_XGIVEREF(__pyx_t_3);
11757 __Pyx_XGIVEREF(__pyx_t_4);
11758 __Pyx_XGIVEREF(__pyx_t_5);
11759 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11780 __Pyx_XDECREF(__pyx_r);
11781 __Pyx_INCREF(__pyx_v_obj);
11782 __pyx_r = __pyx_v_obj;
11795 __Pyx_XDECREF(__pyx_t_6);
11796 __Pyx_XDECREF(__pyx_t_7);
11797 __Pyx_XDECREF(__pyx_t_8);
11798 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11801 __Pyx_XDECREF(__pyx_v_obj);
11802 __Pyx_XGIVEREF(__pyx_r);
11803 __Pyx_RefNannyFinishContext();
11815 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11816 __Pyx_memviewslice __pyx_v_dst_slice;
11817 __Pyx_memviewslice __pyx_v_src_slice;
11818 PyObject *__pyx_r = NULL;
11819 __Pyx_RefNannyDeclarations
11820 PyObject *__pyx_t_1 = NULL;
11824 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
11833 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 440, __pyx_L1_error)
11842 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 441, __pyx_L1_error)
11851 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
11852 __Pyx_GOTREF(__pyx_t_1);
11853 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_2 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
11854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11855 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
11856 __Pyx_GOTREF(__pyx_t_1);
11857 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 442, __pyx_L1_error)
11858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11867 __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 440, __pyx_L1_error)
11878 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11881 __Pyx_XDECREF(__pyx_t_1);
11882 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11885 __Pyx_XGIVEREF(__pyx_r);
11886 __Pyx_RefNannyFinishContext();
11898 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11899 int __pyx_v_array[0x80];
11901 void *__pyx_v_item;
11902 __Pyx_memviewslice *__pyx_v_dst_slice;
11903 __Pyx_memviewslice __pyx_v_tmp_slice;
11904 PyObject *__pyx_r = NULL;
11905 __Pyx_RefNannyDeclarations
11907 PyObject *__pyx_t_2 = NULL;
11910 char const *__pyx_t_5;
11911 PyObject *__pyx_t_6 = NULL;
11912 PyObject *__pyx_t_7 = NULL;
11913 PyObject *__pyx_t_8 = NULL;
11914 PyObject *__pyx_t_9 = NULL;
11915 PyObject *__pyx_t_10 = NULL;
11916 PyObject *__pyx_t_11 = NULL;
11917 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
11926 __pyx_v_tmp = NULL;
11935 __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
11944 __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
11954 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11963 __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
11964 if (unlikely(__pyx_t_1)) {
11973 PyErr_NoMemory(); __PYX_ERR(1, 456, __pyx_L1_error)
11991 __pyx_v_item = __pyx_v_tmp;
12011 __pyx_v_item = ((
void *)__pyx_v_array);
12031 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
12041 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
12061 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 465, __pyx_L6_error)
12062 __Pyx_GOTREF(__pyx_t_2);
12063 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12074 __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
12084 __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 470, __pyx_L6_error)
12085 __Pyx_GOTREF(__pyx_t_2);
12086 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12104 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
12116 PyMem_Free(__pyx_v_tmp);
12121 __Pyx_PyThreadState_declare
12122 __Pyx_PyThreadState_assign
12123 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12124 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12125 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
12126 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
12127 __Pyx_XGOTREF(__pyx_t_6);
12128 __Pyx_XGOTREF(__pyx_t_7);
12129 __Pyx_XGOTREF(__pyx_t_8);
12130 __Pyx_XGOTREF(__pyx_t_9);
12131 __Pyx_XGOTREF(__pyx_t_10);
12132 __Pyx_XGOTREF(__pyx_t_11);
12133 __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
12135 PyMem_Free(__pyx_v_tmp);
12137 if (PY_MAJOR_VERSION >= 3) {
12138 __Pyx_XGIVEREF(__pyx_t_9);
12139 __Pyx_XGIVEREF(__pyx_t_10);
12140 __Pyx_XGIVEREF(__pyx_t_11);
12141 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
12143 __Pyx_XGIVEREF(__pyx_t_6);
12144 __Pyx_XGIVEREF(__pyx_t_7);
12145 __Pyx_XGIVEREF(__pyx_t_8);
12146 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
12147 __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
12148 __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
12149 goto __pyx_L1_error;
12163 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12166 __Pyx_XDECREF(__pyx_t_2);
12167 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
12170 __Pyx_XGIVEREF(__pyx_r);
12171 __Pyx_RefNannyFinishContext();
12183 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
12184 char *__pyx_v_itemp;
12185 PyObject *__pyx_r = NULL;
12186 __Pyx_RefNannyDeclarations
12188 PyObject *__pyx_t_2 = NULL;
12189 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
12198 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 477, __pyx_L1_error)
12199 __pyx_v_itemp = __pyx_t_1;
12208 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 478, __pyx_L1_error)
12209 __Pyx_GOTREF(__pyx_t_2);
12210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12221 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12224 __Pyx_XDECREF(__pyx_t_2);
12225 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
12228 __Pyx_XGIVEREF(__pyx_r);
12229 __Pyx_RefNannyFinishContext();
12241 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
12242 PyObject *__pyx_v_struct = NULL;
12243 PyObject *__pyx_v_bytesitem = 0;
12244 PyObject *__pyx_v_result = NULL;
12245 PyObject *__pyx_r = NULL;
12246 __Pyx_RefNannyDeclarations
12247 PyObject *__pyx_t_1 = NULL;
12248 PyObject *__pyx_t_2 = NULL;
12249 PyObject *__pyx_t_3 = NULL;
12250 PyObject *__pyx_t_4 = NULL;
12251 PyObject *__pyx_t_5 = NULL;
12252 PyObject *__pyx_t_6 = NULL;
12253 PyObject *__pyx_t_7 = NULL;
12255 PyObject *__pyx_t_9 = NULL;
12258 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
12267 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L1_error)
12268 __Pyx_GOTREF(__pyx_t_1);
12269 __pyx_v_struct = __pyx_t_1;
12279 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 486, __pyx_L1_error)
12280 __Pyx_GOTREF(__pyx_t_1);
12281 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
12292 __Pyx_PyThreadState_declare
12293 __Pyx_PyThreadState_assign
12294 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12295 __Pyx_XGOTREF(__pyx_t_2);
12296 __Pyx_XGOTREF(__pyx_t_3);
12297 __Pyx_XGOTREF(__pyx_t_4);
12307 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 488, __pyx_L3_error)
12308 __Pyx_GOTREF(__pyx_t_5);
12309 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 488, __pyx_L3_error)
12310 __Pyx_GOTREF(__pyx_t_6);
12313 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12314 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12315 if (likely(__pyx_t_7)) {
12316 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
12317 __Pyx_INCREF(__pyx_t_7);
12318 __Pyx_INCREF(
function);
12319 __Pyx_DECREF_SET(__pyx_t_5,
function);
12323 #if CYTHON_FAST_PYCALL
12324 if (PyFunction_Check(__pyx_t_5)) {
12325 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12326 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12327 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12328 __Pyx_GOTREF(__pyx_t_1);
12329 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12332 #if CYTHON_FAST_PYCCALL
12333 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12334 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12335 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12336 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12337 __Pyx_GOTREF(__pyx_t_1);
12338 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12342 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 488, __pyx_L3_error)
12343 __Pyx_GOTREF(__pyx_t_9);
12345 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12347 __Pyx_GIVEREF(__pyx_t_6);
12348 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12349 __Pyx_INCREF(__pyx_v_bytesitem);
12350 __Pyx_GIVEREF(__pyx_v_bytesitem);
12351 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12353 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L3_error)
12354 __Pyx_GOTREF(__pyx_t_1);
12355 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12358 __pyx_v_result = __pyx_t_1;
12378 __pyx_t_10 = strlen(__pyx_v_self->view.format);
12379 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12389 __Pyx_XDECREF(__pyx_r);
12390 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L5_except_error)
12391 __Pyx_GOTREF(__pyx_t_1);
12392 __pyx_r = __pyx_t_1;
12394 goto __pyx_L6_except_return;
12412 __Pyx_XDECREF(__pyx_r);
12413 __Pyx_INCREF(__pyx_v_result);
12414 __pyx_r = __pyx_v_result;
12415 goto __pyx_L6_except_return;
12418 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12419 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12420 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12421 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12422 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12431 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12432 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 489, __pyx_L5_except_error)
12433 __Pyx_GOTREF(__pyx_t_6);
12434 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12435 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12436 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12437 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12439 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12440 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 489, __pyx_L5_except_error)
12441 __Pyx_GOTREF(__pyx_t_9);
12442 __Pyx_GOTREF(__pyx_t_5);
12443 __Pyx_GOTREF(__pyx_t_1);
12452 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 490, __pyx_L5_except_error)
12453 __Pyx_GOTREF(__pyx_t_6);
12454 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12455 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12456 __PYX_ERR(1, 490, __pyx_L5_except_error)
12458 goto __pyx_L5_except_error;
12459 __pyx_L5_except_error:;
12468 __Pyx_XGIVEREF(__pyx_t_2);
12469 __Pyx_XGIVEREF(__pyx_t_3);
12470 __Pyx_XGIVEREF(__pyx_t_4);
12471 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12472 goto __pyx_L1_error;
12473 __pyx_L6_except_return:;
12474 __Pyx_XGIVEREF(__pyx_t_2);
12475 __Pyx_XGIVEREF(__pyx_t_3);
12476 __Pyx_XGIVEREF(__pyx_t_4);
12477 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12491 __Pyx_XDECREF(__pyx_t_1);
12492 __Pyx_XDECREF(__pyx_t_5);
12493 __Pyx_XDECREF(__pyx_t_6);
12494 __Pyx_XDECREF(__pyx_t_7);
12495 __Pyx_XDECREF(__pyx_t_9);
12496 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12499 __Pyx_XDECREF(__pyx_v_struct);
12500 __Pyx_XDECREF(__pyx_v_bytesitem);
12501 __Pyx_XDECREF(__pyx_v_result);
12502 __Pyx_XGIVEREF(__pyx_r);
12503 __Pyx_RefNannyFinishContext();
12515 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12516 PyObject *__pyx_v_struct = NULL;
12518 PyObject *__pyx_v_bytesvalue = 0;
12519 Py_ssize_t __pyx_v_i;
12520 PyObject *__pyx_r = NULL;
12521 __Pyx_RefNannyDeclarations
12522 PyObject *__pyx_t_1 = NULL;
12525 PyObject *__pyx_t_4 = NULL;
12526 PyObject *__pyx_t_5 = NULL;
12527 PyObject *__pyx_t_6 = NULL;
12529 PyObject *__pyx_t_8 = NULL;
12530 Py_ssize_t __pyx_t_9;
12531 PyObject *__pyx_t_10 = NULL;
12536 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
12545 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
12546 __Pyx_GOTREF(__pyx_t_1);
12547 __pyx_v_struct = __pyx_t_1;
12557 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12558 __pyx_t_3 = (__pyx_t_2 != 0);
12568 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 505, __pyx_L1_error)
12569 __Pyx_GOTREF(__pyx_t_1);
12570 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12571 __Pyx_GOTREF(__pyx_t_4);
12572 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 505, __pyx_L1_error)
12573 __Pyx_GOTREF(__pyx_t_5);
12574 __Pyx_GIVEREF(__pyx_t_4);
12575 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12577 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12578 __Pyx_GOTREF(__pyx_t_4);
12579 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 505, __pyx_L1_error)
12580 __Pyx_GOTREF(__pyx_t_6);
12581 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12582 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12583 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 505, __pyx_L1_error)
12584 __Pyx_GOTREF(__pyx_t_4);
12585 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12586 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12587 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 505, __pyx_L1_error)
12588 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12609 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 507, __pyx_L1_error)
12610 __Pyx_GOTREF(__pyx_t_6);
12611 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 507, __pyx_L1_error)
12612 __Pyx_GOTREF(__pyx_t_1);
12615 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12616 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12617 if (likely(__pyx_t_5)) {
12618 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
12619 __Pyx_INCREF(__pyx_t_5);
12620 __Pyx_INCREF(
function);
12621 __Pyx_DECREF_SET(__pyx_t_6,
function);
12625 #if CYTHON_FAST_PYCALL
12626 if (PyFunction_Check(__pyx_t_6)) {
12627 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12628 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12629 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12630 __Pyx_GOTREF(__pyx_t_4);
12631 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12634 #if CYTHON_FAST_PYCCALL
12635 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12636 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12637 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12638 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12639 __Pyx_GOTREF(__pyx_t_4);
12640 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12644 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 507, __pyx_L1_error)
12645 __Pyx_GOTREF(__pyx_t_8);
12647 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12649 __Pyx_GIVEREF(__pyx_t_1);
12650 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12651 __Pyx_INCREF(__pyx_v_value);
12652 __Pyx_GIVEREF(__pyx_v_value);
12653 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12655 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 507, __pyx_L1_error)
12656 __Pyx_GOTREF(__pyx_t_4);
12657 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12659 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12660 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 507, __pyx_L1_error)
12661 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12674 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12675 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
12676 __PYX_ERR(1, 509, __pyx_L1_error)
12678 __Pyx_INCREF(__pyx_v_bytesvalue);
12679 __pyx_t_10 = __pyx_v_bytesvalue;
12680 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12681 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12682 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12683 __pyx_t_11 = __pyx_t_14;
12684 __pyx_v_c = (__pyx_t_11[0]);
12693 __pyx_v_i = __pyx_t_9;
12702 __pyx_t_9 = (__pyx_t_9 + 1);
12711 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12713 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12724 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12727 __Pyx_XDECREF(__pyx_t_1);
12728 __Pyx_XDECREF(__pyx_t_4);
12729 __Pyx_XDECREF(__pyx_t_5);
12730 __Pyx_XDECREF(__pyx_t_6);
12731 __Pyx_XDECREF(__pyx_t_8);
12732 __Pyx_XDECREF(__pyx_t_10);
12733 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12736 __Pyx_XDECREF(__pyx_v_struct);
12737 __Pyx_XDECREF(__pyx_v_bytesvalue);
12738 __Pyx_XGIVEREF(__pyx_r);
12739 __Pyx_RefNannyFinishContext();
12752 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
12753 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12755 __Pyx_RefNannyDeclarations
12756 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
12757 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
12760 __Pyx_RefNannyFinishContext();
12764 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
12766 __Pyx_RefNannyDeclarations
12769 PyObject *__pyx_t_3 = NULL;
12770 Py_ssize_t *__pyx_t_4;
12774 Py_ssize_t __pyx_t_8;
12775 if (__pyx_v_info == NULL) {
12776 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
12779 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
12780 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12781 __Pyx_GIVEREF(__pyx_v_info->obj);
12790 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12793 __pyx_t_1 = __pyx_t_2;
12794 goto __pyx_L4_bool_binop_done;
12796 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12797 __pyx_t_1 = __pyx_t_2;
12798 __pyx_L4_bool_binop_done:;
12799 if (unlikely(__pyx_t_1)) {
12808 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 515, __pyx_L1_error)
12809 __Pyx_GOTREF(__pyx_t_3);
12810 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12811 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12812 __PYX_ERR(1, 515, __pyx_L1_error)
12830 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12840 __pyx_t_4 = __pyx_v_self->view.shape;
12841 __pyx_v_info->shape = __pyx_t_4;
12861 __pyx_v_info->shape = NULL;
12872 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12882 __pyx_t_4 = __pyx_v_self->view.strides;
12883 __pyx_v_info->strides = __pyx_t_4;
12903 __pyx_v_info->strides = NULL;
12914 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12924 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12925 __pyx_v_info->suboffsets = __pyx_t_4;
12945 __pyx_v_info->suboffsets = NULL;
12956 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12966 __pyx_t_5 = __pyx_v_self->view.format;
12967 __pyx_v_info->format = __pyx_t_5;
12987 __pyx_v_info->format = NULL;
12998 __pyx_t_6 = __pyx_v_self->view.buf;
12999 __pyx_v_info->buf = __pyx_t_6;
13008 __pyx_t_7 = __pyx_v_self->view.ndim;
13009 __pyx_v_info->ndim = __pyx_t_7;
13018 __pyx_t_8 = __pyx_v_self->view.itemsize;
13019 __pyx_v_info->itemsize = __pyx_t_8;
13028 __pyx_t_8 = __pyx_v_self->view.len;
13029 __pyx_v_info->len = __pyx_t_8;
13038 __pyx_t_1 = __pyx_v_self->view.readonly;
13039 __pyx_v_info->readonly = __pyx_t_1;
13048 __Pyx_INCREF(((PyObject *)__pyx_v_self));
13049 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
13050 __Pyx_GOTREF(__pyx_v_info->obj);
13051 __Pyx_DECREF(__pyx_v_info->obj);
13052 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
13066 __Pyx_XDECREF(__pyx_t_3);
13067 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13069 if (__pyx_v_info->obj != NULL) {
13070 __Pyx_GOTREF(__pyx_v_info->obj);
13071 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13075 if (__pyx_v_info->obj == Py_None) {
13076 __Pyx_GOTREF(__pyx_v_info->obj);
13077 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
13080 __Pyx_RefNannyFinishContext();
13093 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
13094 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
13095 PyObject *__pyx_r = 0;
13096 __Pyx_RefNannyDeclarations
13097 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13098 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13101 __Pyx_RefNannyFinishContext();
13105 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13106 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
13107 PyObject *__pyx_r = NULL;
13108 __Pyx_RefNannyDeclarations
13109 PyObject *__pyx_t_1 = NULL;
13111 __Pyx_RefNannySetupContext(
"__get__", 0);
13120 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 549, __pyx_L1_error)
13121 __Pyx_GOTREF(__pyx_t_1);
13122 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 549, __pyx_L1_error)
13123 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
13133 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 550, __pyx_L1_error)
13142 __Pyx_XDECREF(__pyx_r);
13143 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13144 __pyx_r = ((PyObject *)__pyx_v_result);
13157 __Pyx_XDECREF(__pyx_t_1);
13158 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13161 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13162 __Pyx_XGIVEREF(__pyx_r);
13163 __Pyx_RefNannyFinishContext();
13176 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
13177 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
13178 PyObject *__pyx_r = 0;
13179 __Pyx_RefNannyDeclarations
13180 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13181 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13184 __Pyx_RefNannyFinishContext();
13188 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13189 PyObject *__pyx_r = NULL;
13190 __Pyx_RefNannyDeclarations
13191 __Pyx_RefNannySetupContext(
"__get__", 0);
13200 __Pyx_XDECREF(__pyx_r);
13201 __Pyx_INCREF(__pyx_v_self->obj);
13202 __pyx_r = __pyx_v_self->obj;
13215 __Pyx_XGIVEREF(__pyx_r);
13216 __Pyx_RefNannyFinishContext();
13229 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
13230 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
13231 PyObject *__pyx_r = 0;
13232 __Pyx_RefNannyDeclarations
13233 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13234 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13237 __Pyx_RefNannyFinishContext();
13241 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13242 Py_ssize_t __pyx_v_length;
13243 PyObject *__pyx_r = NULL;
13244 __Pyx_RefNannyDeclarations
13245 PyObject *__pyx_t_1 = NULL;
13246 Py_ssize_t *__pyx_t_2;
13247 Py_ssize_t *__pyx_t_3;
13248 Py_ssize_t *__pyx_t_4;
13249 PyObject *__pyx_t_5 = NULL;
13250 __Pyx_RefNannySetupContext(
"__get__", 0);
13259 __Pyx_XDECREF(__pyx_r);
13260 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 559, __pyx_L1_error)
13261 __Pyx_GOTREF(__pyx_t_1);
13262 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13263 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
13264 __pyx_t_2 = __pyx_t_4;
13265 __pyx_v_length = (__pyx_t_2[0]);
13266 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13267 __Pyx_GOTREF(__pyx_t_5);
13268 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 559, __pyx_L1_error)
13269 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13271 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 559, __pyx_L1_error)
13272 __Pyx_GOTREF(__pyx_t_5);
13273 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13274 __pyx_r = __pyx_t_5;
13288 __Pyx_XDECREF(__pyx_t_1);
13289 __Pyx_XDECREF(__pyx_t_5);
13290 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13293 __Pyx_XGIVEREF(__pyx_r);
13294 __Pyx_RefNannyFinishContext();
13307 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
13308 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13309 PyObject *__pyx_r = 0;
13310 __Pyx_RefNannyDeclarations
13311 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13312 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13315 __Pyx_RefNannyFinishContext();
13319 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13320 Py_ssize_t __pyx_v_stride;
13321 PyObject *__pyx_r = NULL;
13322 __Pyx_RefNannyDeclarations
13324 PyObject *__pyx_t_2 = NULL;
13325 Py_ssize_t *__pyx_t_3;
13326 Py_ssize_t *__pyx_t_4;
13327 Py_ssize_t *__pyx_t_5;
13328 PyObject *__pyx_t_6 = NULL;
13329 __Pyx_RefNannySetupContext(
"__get__", 0);
13338 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13339 if (unlikely(__pyx_t_1)) {
13348 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
13349 __Pyx_GOTREF(__pyx_t_2);
13350 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13351 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13352 __PYX_ERR(1, 565, __pyx_L1_error)
13370 __Pyx_XDECREF(__pyx_r);
13371 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 567, __pyx_L1_error)
13372 __Pyx_GOTREF(__pyx_t_2);
13373 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13374 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13375 __pyx_t_3 = __pyx_t_5;
13376 __pyx_v_stride = (__pyx_t_3[0]);
13377 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13378 __Pyx_GOTREF(__pyx_t_6);
13379 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 567, __pyx_L1_error)
13380 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13382 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 567, __pyx_L1_error)
13383 __Pyx_GOTREF(__pyx_t_6);
13384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13385 __pyx_r = __pyx_t_6;
13399 __Pyx_XDECREF(__pyx_t_2);
13400 __Pyx_XDECREF(__pyx_t_6);
13401 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13404 __Pyx_XGIVEREF(__pyx_r);
13405 __Pyx_RefNannyFinishContext();
13418 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
13419 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13420 PyObject *__pyx_r = 0;
13421 __Pyx_RefNannyDeclarations
13422 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13423 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13426 __Pyx_RefNannyFinishContext();
13430 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13431 Py_ssize_t __pyx_v_suboffset;
13432 PyObject *__pyx_r = NULL;
13433 __Pyx_RefNannyDeclarations
13435 PyObject *__pyx_t_2 = NULL;
13436 PyObject *__pyx_t_3 = NULL;
13437 Py_ssize_t *__pyx_t_4;
13438 Py_ssize_t *__pyx_t_5;
13439 Py_ssize_t *__pyx_t_6;
13440 __Pyx_RefNannySetupContext(
"__get__", 0);
13449 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13459 __Pyx_XDECREF(__pyx_r);
13460 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
13461 __Pyx_GOTREF(__pyx_t_2);
13462 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__26, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 572, __pyx_L1_error)
13463 __Pyx_GOTREF(__pyx_t_3);
13464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13465 __pyx_r = __pyx_t_3;
13485 __Pyx_XDECREF(__pyx_r);
13486 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 574, __pyx_L1_error)
13487 __Pyx_GOTREF(__pyx_t_3);
13488 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13489 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13490 __pyx_t_4 = __pyx_t_6;
13491 __pyx_v_suboffset = (__pyx_t_4[0]);
13492 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13493 __Pyx_GOTREF(__pyx_t_2);
13494 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 574, __pyx_L1_error)
13495 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13497 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
13498 __Pyx_GOTREF(__pyx_t_2);
13499 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13500 __pyx_r = __pyx_t_2;
13514 __Pyx_XDECREF(__pyx_t_2);
13515 __Pyx_XDECREF(__pyx_t_3);
13516 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13519 __Pyx_XGIVEREF(__pyx_r);
13520 __Pyx_RefNannyFinishContext();
13533 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
13534 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13535 PyObject *__pyx_r = 0;
13536 __Pyx_RefNannyDeclarations
13537 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13538 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13541 __Pyx_RefNannyFinishContext();
13545 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13546 PyObject *__pyx_r = NULL;
13547 __Pyx_RefNannyDeclarations
13548 PyObject *__pyx_t_1 = NULL;
13549 __Pyx_RefNannySetupContext(
"__get__", 0);
13558 __Pyx_XDECREF(__pyx_r);
13559 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 578, __pyx_L1_error)
13560 __Pyx_GOTREF(__pyx_t_1);
13561 __pyx_r = __pyx_t_1;
13575 __Pyx_XDECREF(__pyx_t_1);
13576 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13579 __Pyx_XGIVEREF(__pyx_r);
13580 __Pyx_RefNannyFinishContext();
13593 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
13594 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13595 PyObject *__pyx_r = 0;
13596 __Pyx_RefNannyDeclarations
13597 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13598 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13601 __Pyx_RefNannyFinishContext();
13605 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13606 PyObject *__pyx_r = NULL;
13607 __Pyx_RefNannyDeclarations
13608 PyObject *__pyx_t_1 = NULL;
13609 __Pyx_RefNannySetupContext(
"__get__", 0);
13618 __Pyx_XDECREF(__pyx_r);
13619 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 582, __pyx_L1_error)
13620 __Pyx_GOTREF(__pyx_t_1);
13621 __pyx_r = __pyx_t_1;
13635 __Pyx_XDECREF(__pyx_t_1);
13636 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13639 __Pyx_XGIVEREF(__pyx_r);
13640 __Pyx_RefNannyFinishContext();
13653 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
13654 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13655 PyObject *__pyx_r = 0;
13656 __Pyx_RefNannyDeclarations
13657 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13658 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13661 __Pyx_RefNannyFinishContext();
13665 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13666 PyObject *__pyx_r = NULL;
13667 __Pyx_RefNannyDeclarations
13668 PyObject *__pyx_t_1 = NULL;
13669 PyObject *__pyx_t_2 = NULL;
13670 PyObject *__pyx_t_3 = NULL;
13671 __Pyx_RefNannySetupContext(
"__get__", 0);
13680 __Pyx_XDECREF(__pyx_r);
13681 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 586, __pyx_L1_error)
13682 __Pyx_GOTREF(__pyx_t_1);
13683 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 586, __pyx_L1_error)
13684 __Pyx_GOTREF(__pyx_t_2);
13685 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
13686 __Pyx_GOTREF(__pyx_t_3);
13687 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13688 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13689 __pyx_r = __pyx_t_3;
13703 __Pyx_XDECREF(__pyx_t_1);
13704 __Pyx_XDECREF(__pyx_t_2);
13705 __Pyx_XDECREF(__pyx_t_3);
13706 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13709 __Pyx_XGIVEREF(__pyx_r);
13710 __Pyx_RefNannyFinishContext();
13723 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
13724 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13725 PyObject *__pyx_r = 0;
13726 __Pyx_RefNannyDeclarations
13727 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
13728 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13731 __Pyx_RefNannyFinishContext();
13735 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13736 PyObject *__pyx_v_result = NULL;
13737 PyObject *__pyx_v_length = NULL;
13738 PyObject *__pyx_r = NULL;
13739 __Pyx_RefNannyDeclarations
13742 Py_ssize_t *__pyx_t_3;
13743 Py_ssize_t *__pyx_t_4;
13744 Py_ssize_t *__pyx_t_5;
13745 PyObject *__pyx_t_6 = NULL;
13746 __Pyx_RefNannySetupContext(
"__get__", 0);
13755 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13756 __pyx_t_2 = (__pyx_t_1 != 0);
13766 __Pyx_INCREF(__pyx_int_1);
13767 __pyx_v_result = __pyx_int_1;
13776 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13777 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13778 __pyx_t_3 = __pyx_t_5;
13779 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 593, __pyx_L1_error)
13780 __Pyx_GOTREF(__pyx_t_6);
13781 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13791 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 594, __pyx_L1_error)
13792 __Pyx_GOTREF(__pyx_t_6);
13793 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13804 __Pyx_INCREF(__pyx_v_result);
13805 __Pyx_GIVEREF(__pyx_v_result);
13806 __Pyx_GOTREF(__pyx_v_self->_size);
13807 __Pyx_DECREF(__pyx_v_self->_size);
13808 __pyx_v_self->_size = __pyx_v_result;
13826 __Pyx_XDECREF(__pyx_r);
13827 __Pyx_INCREF(__pyx_v_self->_size);
13828 __pyx_r = __pyx_v_self->_size;
13841 __Pyx_XDECREF(__pyx_t_6);
13842 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13845 __Pyx_XDECREF(__pyx_v_result);
13846 __Pyx_XDECREF(__pyx_v_length);
13847 __Pyx_XGIVEREF(__pyx_r);
13848 __Pyx_RefNannyFinishContext();
13861 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13862 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13863 Py_ssize_t __pyx_r;
13864 __Pyx_RefNannyDeclarations
13865 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13866 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13869 __Pyx_RefNannyFinishContext();
13873 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13874 Py_ssize_t __pyx_r;
13875 __Pyx_RefNannyDeclarations
13877 __Pyx_RefNannySetupContext(
"__len__", 0);
13886 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13896 __pyx_r = (__pyx_v_self->view.shape[0]);
13928 __Pyx_RefNannyFinishContext();
13941 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13942 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13943 PyObject *__pyx_r = 0;
13944 __Pyx_RefNannyDeclarations
13945 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13946 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13949 __Pyx_RefNannyFinishContext();
13953 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13954 PyObject *__pyx_r = NULL;
13955 __Pyx_RefNannyDeclarations
13956 PyObject *__pyx_t_1 = NULL;
13957 PyObject *__pyx_t_2 = NULL;
13958 PyObject *__pyx_t_3 = NULL;
13959 __Pyx_RefNannySetupContext(
"__repr__", 0);
13968 __Pyx_XDECREF(__pyx_r);
13969 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
13970 __Pyx_GOTREF(__pyx_t_1);
13971 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
13972 __Pyx_GOTREF(__pyx_t_2);
13973 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13974 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 607, __pyx_L1_error)
13975 __Pyx_GOTREF(__pyx_t_1);
13976 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13985 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 608, __pyx_L1_error)
13986 __Pyx_GOTREF(__pyx_t_2);
13995 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
13996 __Pyx_GOTREF(__pyx_t_3);
13997 __Pyx_GIVEREF(__pyx_t_1);
13998 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13999 __Pyx_GIVEREF(__pyx_t_2);
14000 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
14003 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 607, __pyx_L1_error)
14004 __Pyx_GOTREF(__pyx_t_2);
14005 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14006 __pyx_r = __pyx_t_2;
14020 __Pyx_XDECREF(__pyx_t_1);
14021 __Pyx_XDECREF(__pyx_t_2);
14022 __Pyx_XDECREF(__pyx_t_3);
14023 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14026 __Pyx_XGIVEREF(__pyx_r);
14027 __Pyx_RefNannyFinishContext();
14040 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
14041 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
14042 PyObject *__pyx_r = 0;
14043 __Pyx_RefNannyDeclarations
14044 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
14045 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14048 __Pyx_RefNannyFinishContext();
14052 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
14053 PyObject *__pyx_r = NULL;
14054 __Pyx_RefNannyDeclarations
14055 PyObject *__pyx_t_1 = NULL;
14056 PyObject *__pyx_t_2 = NULL;
14057 __Pyx_RefNannySetupContext(
"__str__", 0);
14066 __Pyx_XDECREF(__pyx_r);
14067 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14068 __Pyx_GOTREF(__pyx_t_1);
14069 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14070 __Pyx_GOTREF(__pyx_t_2);
14071 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14072 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14073 __Pyx_GOTREF(__pyx_t_1);
14074 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14075 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 611, __pyx_L1_error)
14076 __Pyx_GOTREF(__pyx_t_2);
14077 __Pyx_GIVEREF(__pyx_t_1);
14078 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
14080 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 611, __pyx_L1_error)
14081 __Pyx_GOTREF(__pyx_t_1);
14082 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14083 __pyx_r = __pyx_t_1;
14097 __Pyx_XDECREF(__pyx_t_1);
14098 __Pyx_XDECREF(__pyx_t_2);
14099 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14102 __Pyx_XGIVEREF(__pyx_r);
14103 __Pyx_RefNannyFinishContext();
14116 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14117 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
14118 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14119 PyObject *__pyx_r = 0;
14120 __Pyx_RefNannyDeclarations
14121 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
14122 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14125 __Pyx_RefNannyFinishContext();
14129 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14130 __Pyx_memviewslice *__pyx_v_mslice;
14131 __Pyx_memviewslice __pyx_v_tmp;
14132 PyObject *__pyx_r = NULL;
14133 __Pyx_RefNannyDeclarations
14134 PyObject *__pyx_t_1 = NULL;
14135 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
14144 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14153 __Pyx_XDECREF(__pyx_r);
14154 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
14155 __Pyx_GOTREF(__pyx_t_1);
14156 __pyx_r = __pyx_t_1;
14170 __Pyx_XDECREF(__pyx_t_1);
14171 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14174 __Pyx_XGIVEREF(__pyx_r);
14175 __Pyx_RefNannyFinishContext();
14188 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14189 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
14190 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14191 PyObject *__pyx_r = 0;
14192 __Pyx_RefNannyDeclarations
14193 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
14194 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14197 __Pyx_RefNannyFinishContext();
14201 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
14202 __Pyx_memviewslice *__pyx_v_mslice;
14203 __Pyx_memviewslice __pyx_v_tmp;
14204 PyObject *__pyx_r = NULL;
14205 __Pyx_RefNannyDeclarations
14206 PyObject *__pyx_t_1 = NULL;
14207 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
14216 __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
14225 __Pyx_XDECREF(__pyx_r);
14226 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 624, __pyx_L1_error)
14227 __Pyx_GOTREF(__pyx_t_1);
14228 __pyx_r = __pyx_t_1;
14242 __Pyx_XDECREF(__pyx_t_1);
14243 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
14246 __Pyx_XGIVEREF(__pyx_r);
14247 __Pyx_RefNannyFinishContext();
14260 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14261 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
14262 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14263 PyObject *__pyx_r = 0;
14264 __Pyx_RefNannyDeclarations
14265 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
14266 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14269 __Pyx_RefNannyFinishContext();
14273 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
14274 __Pyx_memviewslice __pyx_v_mslice;
14276 PyObject *__pyx_r = NULL;
14277 __Pyx_RefNannyDeclarations
14278 __Pyx_memviewslice __pyx_t_1;
14279 PyObject *__pyx_t_2 = NULL;
14280 __Pyx_RefNannySetupContext(
"copy", 0);
14289 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
14298 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14307 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 631, __pyx_L1_error)
14308 __pyx_v_mslice = __pyx_t_1;
14317 __Pyx_XDECREF(__pyx_r);
14318 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 636, __pyx_L1_error)
14319 __Pyx_GOTREF(__pyx_t_2);
14320 __pyx_r = __pyx_t_2;
14334 __Pyx_XDECREF(__pyx_t_2);
14335 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14338 __Pyx_XGIVEREF(__pyx_r);
14339 __Pyx_RefNannyFinishContext();
14352 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14353 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14354 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14355 PyObject *__pyx_r = 0;
14356 __Pyx_RefNannyDeclarations
14357 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
14358 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14361 __Pyx_RefNannyFinishContext();
14365 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
14366 __Pyx_memviewslice __pyx_v_src;
14367 __Pyx_memviewslice __pyx_v_dst;
14369 PyObject *__pyx_r = NULL;
14370 __Pyx_RefNannyDeclarations
14371 __Pyx_memviewslice __pyx_t_1;
14372 PyObject *__pyx_t_2 = NULL;
14373 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
14382 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14391 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14400 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 643, __pyx_L1_error)
14401 __pyx_v_dst = __pyx_t_1;
14410 __Pyx_XDECREF(__pyx_r);
14411 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 648, __pyx_L1_error)
14412 __Pyx_GOTREF(__pyx_t_2);
14413 __pyx_r = __pyx_t_2;
14427 __Pyx_XDECREF(__pyx_t_2);
14428 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14431 __Pyx_XGIVEREF(__pyx_r);
14432 __Pyx_RefNannyFinishContext();
14443 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
14444 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14445 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14446 PyObject *__pyx_r = 0;
14447 __Pyx_RefNannyDeclarations
14448 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
14449 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
14452 __Pyx_RefNannyFinishContext();
14456 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
14457 PyObject *__pyx_r = NULL;
14458 __Pyx_RefNannyDeclarations
14459 PyObject *__pyx_t_1 = NULL;
14460 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
14468 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
14469 __Pyx_GOTREF(__pyx_t_1);
14470 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14471 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14472 __PYX_ERR(1, 2, __pyx_L1_error)
14482 __Pyx_XDECREF(__pyx_t_1);
14483 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14485 __Pyx_XGIVEREF(__pyx_r);
14486 __Pyx_RefNannyFinishContext();
14498 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
14499 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14500 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14501 PyObject *__pyx_r = 0;
14502 __Pyx_RefNannyDeclarations
14503 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
14504 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14507 __Pyx_RefNannyFinishContext();
14511 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14512 PyObject *__pyx_r = NULL;
14513 __Pyx_RefNannyDeclarations
14514 PyObject *__pyx_t_1 = NULL;
14515 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
14522 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
14523 __Pyx_GOTREF(__pyx_t_1);
14524 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14525 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14526 __PYX_ERR(1, 4, __pyx_L1_error)
14537 __Pyx_XDECREF(__pyx_t_1);
14538 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14540 __Pyx_XGIVEREF(__pyx_r);
14541 __Pyx_RefNannyFinishContext();
14553 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14554 struct __pyx_memoryview_obj *__pyx_v_result = 0;
14555 PyObject *__pyx_r = NULL;
14556 __Pyx_RefNannyDeclarations
14557 PyObject *__pyx_t_1 = NULL;
14558 PyObject *__pyx_t_2 = NULL;
14559 PyObject *__pyx_t_3 = NULL;
14560 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
14569 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
14570 __Pyx_GOTREF(__pyx_t_1);
14571 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14572 __Pyx_GOTREF(__pyx_t_2);
14573 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
14574 __Pyx_GOTREF(__pyx_t_3);
14575 __Pyx_INCREF(__pyx_v_o);
14576 __Pyx_GIVEREF(__pyx_v_o);
14577 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14578 __Pyx_GIVEREF(__pyx_t_1);
14579 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14580 __Pyx_GIVEREF(__pyx_t_2);
14581 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14584 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
14585 __Pyx_GOTREF(__pyx_t_2);
14586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14587 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
14597 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14606 __Pyx_XDECREF(__pyx_r);
14607 __Pyx_INCREF(((PyObject *)__pyx_v_result));
14608 __pyx_r = ((PyObject *)__pyx_v_result);
14621 __Pyx_XDECREF(__pyx_t_1);
14622 __Pyx_XDECREF(__pyx_t_2);
14623 __Pyx_XDECREF(__pyx_t_3);
14624 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14627 __Pyx_XDECREF((PyObject *)__pyx_v_result);
14628 __Pyx_XGIVEREF(__pyx_r);
14629 __Pyx_RefNannyFinishContext();
14641 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14643 __Pyx_RefNannyDeclarations
14645 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
14654 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14655 __pyx_r = __pyx_t_1;
14668 __Pyx_RefNannyFinishContext();
14680 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
14681 PyObject *__pyx_v_tup = NULL;
14682 PyObject *__pyx_v_result = NULL;
14683 int __pyx_v_have_slices;
14684 int __pyx_v_seen_ellipsis;
14685 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14686 PyObject *__pyx_v_item = NULL;
14687 Py_ssize_t __pyx_v_nslices;
14688 PyObject *__pyx_r = NULL;
14689 __Pyx_RefNannyDeclarations
14692 PyObject *__pyx_t_3 = NULL;
14693 PyObject *__pyx_t_4 = NULL;
14694 Py_ssize_t __pyx_t_5;
14695 PyObject *(*__pyx_t_6)(PyObject *);
14696 PyObject *__pyx_t_7 = NULL;
14697 Py_ssize_t __pyx_t_8;
14700 PyObject *__pyx_t_11 = NULL;
14701 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14710 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14711 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14721 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 667, __pyx_L1_error)
14722 __Pyx_GOTREF(__pyx_t_3);
14723 __Pyx_INCREF(__pyx_v_index);
14724 __Pyx_GIVEREF(__pyx_v_index);
14725 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14726 __pyx_v_tup = __pyx_t_3;
14747 __Pyx_INCREF(__pyx_v_index);
14748 __pyx_v_tup = __pyx_v_index;
14759 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 671, __pyx_L1_error)
14760 __Pyx_GOTREF(__pyx_t_3);
14761 __pyx_v_result = ((PyObject*)__pyx_t_3);
14771 __pyx_v_have_slices = 0;
14780 __pyx_v_seen_ellipsis = 0;
14789 __Pyx_INCREF(__pyx_int_0);
14790 __pyx_t_3 = __pyx_int_0;
14791 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14792 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14795 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 674, __pyx_L1_error)
14796 __Pyx_GOTREF(__pyx_t_4);
14797 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 674, __pyx_L1_error)
14800 if (likely(!__pyx_t_6)) {
14801 if (likely(PyList_CheckExact(__pyx_t_4))) {
14802 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14803 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14804 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
14806 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
14807 __Pyx_GOTREF(__pyx_t_7);
14810 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14811 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14812 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 674, __pyx_L1_error)
14814 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
14815 __Pyx_GOTREF(__pyx_t_7);
14819 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14820 if (unlikely(!__pyx_t_7)) {
14821 PyObject* exc_type = PyErr_Occurred();
14823 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14824 else __PYX_ERR(1, 674, __pyx_L1_error)
14828 __Pyx_GOTREF(__pyx_t_7);
14830 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14832 __Pyx_INCREF(__pyx_t_3);
14833 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14834 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 674, __pyx_L1_error)
14835 __Pyx_GOTREF(__pyx_t_7);
14836 __Pyx_DECREF(__pyx_t_3);
14837 __pyx_t_3 = __pyx_t_7;
14847 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14848 __pyx_t_1 = (__pyx_t_2 != 0);
14858 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14868 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
14869 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 677, __pyx_L1_error)
14870 __Pyx_GOTREF(__pyx_t_7);
14871 { Py_ssize_t __pyx_temp;
14872 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14873 __Pyx_INCREF(__pyx_slice__29);
14874 __Pyx_GIVEREF(__pyx_slice__29);
14875 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__29);
14878 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 677, __pyx_L1_error)
14879 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14888 __pyx_v_seen_ellipsis = 1;
14908 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__30);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 680, __pyx_L1_error)
14919 __pyx_v_have_slices = 1;
14939 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14940 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14943 __pyx_t_1 = __pyx_t_10;
14944 goto __pyx_L9_bool_binop_done;
14946 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14947 __pyx_t_1 = __pyx_t_10;
14948 __pyx_L9_bool_binop_done:;
14949 if (unlikely(__pyx_t_1)) {
14958 __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
14959 __Pyx_GOTREF(__pyx_t_7);
14960 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 684, __pyx_L1_error)
14961 __Pyx_GOTREF(__pyx_t_11);
14962 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14963 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14964 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14965 __PYX_ERR(1, 684, __pyx_L1_error)
14983 __pyx_t_10 = (__pyx_v_have_slices != 0);
14986 __pyx_t_1 = __pyx_t_10;
14987 goto __pyx_L11_bool_binop_done;
14989 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14990 __pyx_t_2 = (__pyx_t_10 != 0);
14991 __pyx_t_1 = __pyx_t_2;
14992 __pyx_L11_bool_binop_done:;
14993 __pyx_v_have_slices = __pyx_t_1;
15002 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
15014 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15015 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15024 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 689, __pyx_L1_error)
15025 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
15034 __pyx_t_1 = (__pyx_v_nslices != 0);
15044 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
15045 __Pyx_GOTREF(__pyx_t_3);
15046 { Py_ssize_t __pyx_temp;
15047 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
15048 __Pyx_INCREF(__pyx_slice__31);
15049 __Pyx_GIVEREF(__pyx_slice__31);
15050 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__31);
15053 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 691, __pyx_L1_error)
15054 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15072 __Pyx_XDECREF(__pyx_r);
15073 if (!__pyx_v_have_slices) {
15075 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15076 __Pyx_GOTREF(__pyx_t_4);
15077 __pyx_t_3 = __pyx_t_4;
15079 goto __pyx_L14_bool_binop_done;
15081 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15082 __Pyx_GOTREF(__pyx_t_4);
15083 __pyx_t_3 = __pyx_t_4;
15085 __pyx_L14_bool_binop_done:;
15086 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 693, __pyx_L1_error)
15087 __Pyx_GOTREF(__pyx_t_4);
15088 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 693, __pyx_L1_error)
15089 __Pyx_GOTREF(__pyx_t_11);
15090 __Pyx_GIVEREF(__pyx_t_3);
15091 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
15092 __Pyx_GIVEREF(__pyx_t_4);
15093 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
15096 __pyx_r = ((PyObject*)__pyx_t_11);
15110 __Pyx_XDECREF(__pyx_t_3);
15111 __Pyx_XDECREF(__pyx_t_4);
15112 __Pyx_XDECREF(__pyx_t_7);
15113 __Pyx_XDECREF(__pyx_t_11);
15114 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
15117 __Pyx_XDECREF(__pyx_v_tup);
15118 __Pyx_XDECREF(__pyx_v_result);
15119 __Pyx_XDECREF(__pyx_v_idx);
15120 __Pyx_XDECREF(__pyx_v_item);
15121 __Pyx_XGIVEREF(__pyx_r);
15122 __Pyx_RefNannyFinishContext();
15134 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
15135 Py_ssize_t __pyx_v_suboffset;
15136 PyObject *__pyx_r = NULL;
15137 __Pyx_RefNannyDeclarations
15138 Py_ssize_t *__pyx_t_1;
15139 Py_ssize_t *__pyx_t_2;
15140 Py_ssize_t *__pyx_t_3;
15142 PyObject *__pyx_t_5 = NULL;
15143 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
15152 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
15153 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
15154 __pyx_t_1 = __pyx_t_3;
15155 __pyx_v_suboffset = (__pyx_t_1[0]);
15164 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
15165 if (unlikely(__pyx_t_4)) {
15174 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 698, __pyx_L1_error)
15175 __Pyx_GOTREF(__pyx_t_5);
15176 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
15177 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15178 __PYX_ERR(1, 698, __pyx_L1_error)
15199 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15202 __Pyx_XDECREF(__pyx_t_5);
15203 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
15206 __Pyx_XGIVEREF(__pyx_r);
15207 __Pyx_RefNannyFinishContext();
15219 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
15220 int __pyx_v_new_ndim;
15221 int __pyx_v_suboffset_dim;
15223 __Pyx_memviewslice __pyx_v_src;
15224 __Pyx_memviewslice __pyx_v_dst;
15225 __Pyx_memviewslice *__pyx_v_p_src;
15226 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
15227 __Pyx_memviewslice *__pyx_v_p_dst;
15228 int *__pyx_v_p_suboffset_dim;
15229 Py_ssize_t __pyx_v_start;
15230 Py_ssize_t __pyx_v_stop;
15231 Py_ssize_t __pyx_v_step;
15232 int __pyx_v_have_start;
15233 int __pyx_v_have_stop;
15234 int __pyx_v_have_step;
15235 PyObject *__pyx_v_index = NULL;
15236 struct __pyx_memoryview_obj *__pyx_r = NULL;
15237 __Pyx_RefNannyDeclarations
15240 PyObject *__pyx_t_3 = NULL;
15241 struct __pyx_memoryview_obj *__pyx_t_4;
15244 Py_ssize_t __pyx_t_7;
15245 PyObject *(*__pyx_t_8)(PyObject *);
15246 PyObject *__pyx_t_9 = NULL;
15247 Py_ssize_t __pyx_t_10;
15249 Py_ssize_t __pyx_t_12;
15250 __Pyx_RefNannySetupContext(
"memview_slice", 0);
15259 __pyx_v_new_ndim = 0;
15260 __pyx_v_suboffset_dim = -1;
15269 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
15278 #ifndef CYTHON_WITHOUT_ASSERTIONS
15279 if (unlikely(!Py_OptimizeFlag)) {
15280 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
15281 PyErr_SetNone(PyExc_AssertionError);
15282 __PYX_ERR(1, 717, __pyx_L1_error)
15294 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15295 __pyx_t_2 = (__pyx_t_1 != 0);
15305 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 720, __pyx_L1_error)
15306 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15307 __Pyx_INCREF(__pyx_t_3);
15308 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15318 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15338 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15347 __pyx_v_p_src = (&__pyx_v_src);
15358 __pyx_t_4 = __pyx_v_p_src->memview;
15359 __pyx_v_dst.memview = __pyx_t_4;
15368 __pyx_t_5 = __pyx_v_p_src->data;
15369 __pyx_v_dst.data = __pyx_t_5;
15378 __pyx_v_p_dst = (&__pyx_v_dst);
15387 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15397 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15398 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15401 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 741, __pyx_L1_error)
15402 __Pyx_GOTREF(__pyx_t_3);
15403 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 741, __pyx_L1_error)
15406 if (likely(!__pyx_t_8)) {
15407 if (likely(PyList_CheckExact(__pyx_t_3))) {
15408 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
15409 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15410 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15412 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15413 __Pyx_GOTREF(__pyx_t_9);
15416 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
15417 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15418 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 741, __pyx_L1_error)
15420 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 741, __pyx_L1_error)
15421 __Pyx_GOTREF(__pyx_t_9);
15425 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15426 if (unlikely(!__pyx_t_9)) {
15427 PyObject* exc_type = PyErr_Occurred();
15429 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15430 else __PYX_ERR(1, 741, __pyx_L1_error)
15434 __Pyx_GOTREF(__pyx_t_9);
15436 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15438 __pyx_v_dim = __pyx_t_6;
15439 __pyx_t_6 = (__pyx_t_6 + 1);
15448 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15458 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
15467 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 743, __pyx_L1_error)
15486 __pyx_t_2 = (__pyx_v_index == Py_None);
15487 __pyx_t_1 = (__pyx_t_2 != 0);
15497 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15506 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15515 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1
L;
15524 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15544 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 755, __pyx_L1_error)
15545 __Pyx_GOTREF(__pyx_t_9);
15546 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 755, __pyx_L1_error)
15548 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15550 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 755, __pyx_L1_error)
15551 __pyx_t_10 = __pyx_t_12;
15552 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15553 goto __pyx_L7_bool_binop_done;
15556 __pyx_L7_bool_binop_done:;
15557 __pyx_v_start = __pyx_t_10;
15566 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 756, __pyx_L1_error)
15567 __Pyx_GOTREF(__pyx_t_9);
15568 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 756, __pyx_L1_error)
15570 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15572 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 756, __pyx_L1_error)
15573 __pyx_t_10 = __pyx_t_12;
15574 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15575 goto __pyx_L9_bool_binop_done;
15578 __pyx_L9_bool_binop_done:;
15579 __pyx_v_stop = __pyx_t_10;
15588 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 757, __pyx_L1_error)
15589 __Pyx_GOTREF(__pyx_t_9);
15590 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 757, __pyx_L1_error)
15592 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15594 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 757, __pyx_L1_error)
15595 __pyx_t_10 = __pyx_t_12;
15596 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15597 goto __pyx_L11_bool_binop_done;
15600 __pyx_L11_bool_binop_done:;
15601 __pyx_v_step = __pyx_t_10;
15610 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 759, __pyx_L1_error)
15611 __Pyx_GOTREF(__pyx_t_9);
15612 __pyx_t_1 = (__pyx_t_9 != Py_None);
15613 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15614 __pyx_v_have_start = __pyx_t_1;
15623 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
15624 __Pyx_GOTREF(__pyx_t_9);
15625 __pyx_t_1 = (__pyx_t_9 != Py_None);
15626 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15627 __pyx_v_have_stop = __pyx_t_1;
15636 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
15637 __Pyx_GOTREF(__pyx_t_9);
15638 __pyx_t_1 = (__pyx_t_9 != Py_None);
15639 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15640 __pyx_v_have_step = __pyx_t_1;
15649 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 763, __pyx_L1_error)
15658 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15670 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15679 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15680 __pyx_t_2 = (__pyx_t_1 != 0);
15690 __Pyx_XDECREF(((PyObject *)__pyx_r));
15699 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 773, __pyx_L1_error) }
15708 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 774, __pyx_L1_error) }
15717 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 772, __pyx_L1_error)
15718 __Pyx_GOTREF(__pyx_t_3);
15719 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 772, __pyx_L1_error)
15720 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15741 __Pyx_XDECREF(((PyObject *)__pyx_r));
15750 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15751 __Pyx_GOTREF(__pyx_t_3);
15760 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15761 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15776 __Pyx_XDECREF(__pyx_t_3);
15777 __Pyx_XDECREF(__pyx_t_9);
15778 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15781 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15782 __Pyx_XDECREF(__pyx_v_index);
15783 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15784 __Pyx_RefNannyFinishContext();
15796 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15797 Py_ssize_t __pyx_v_new_shape;
15798 int __pyx_v_negative_step;
15811 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15821 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15831 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15849 __pyx_t_1 = (0 <= __pyx_v_start);
15851 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15853 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15863 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 827, __pyx_L1_error)
15892 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15895 __pyx_t_2 = __pyx_t_1;
15896 goto __pyx_L6_bool_binop_done;
15898 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15899 __pyx_t_2 = __pyx_t_1;
15900 __pyx_L6_bool_binop_done:;
15901 __pyx_v_negative_step = __pyx_t_2;
15910 __pyx_t_1 = (__pyx_v_have_step != 0);
15913 __pyx_t_2 = __pyx_t_1;
15914 goto __pyx_L9_bool_binop_done;
15916 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15917 __pyx_t_2 = __pyx_t_1;
15918 __pyx_L9_bool_binop_done:;
15928 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 833, __pyx_L1_error)
15946 __pyx_t_2 = (__pyx_v_have_start != 0);
15956 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15966 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15975 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
16013 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
16023 __pyx_t_2 = (__pyx_v_negative_step != 0);
16033 __pyx_v_start = (__pyx_v_shape - 1);
16053 __pyx_v_start = __pyx_v_shape;
16085 __pyx_t_2 = (__pyx_v_negative_step != 0);
16095 __pyx_v_start = (__pyx_v_shape - 1);
16128 __pyx_t_2 = (__pyx_v_have_stop != 0);
16138 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16148 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
16157 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
16195 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
16205 __pyx_v_stop = __pyx_v_shape;
16235 __pyx_t_2 = (__pyx_v_negative_step != 0);
16245 __pyx_v_stop = -1
L;
16265 __pyx_v_stop = __pyx_v_shape;
16278 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
16306 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16315 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16325 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16343 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16353 __pyx_v_new_shape = 0;
16371 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16380 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16389 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16400 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16410 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16430 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16431 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16442 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16452 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16462 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16472 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16500 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 894, __pyx_L1_error)
16522 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16557 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16559 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16561 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16577 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16578 Py_ssize_t __pyx_v_shape;
16579 Py_ssize_t __pyx_v_stride;
16580 Py_ssize_t __pyx_v_suboffset;
16581 Py_ssize_t __pyx_v_itemsize;
16582 char *__pyx_v_resultp;
16584 __Pyx_RefNannyDeclarations
16585 Py_ssize_t __pyx_t_1;
16587 PyObject *__pyx_t_3 = NULL;
16588 PyObject *__pyx_t_4 = NULL;
16589 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16598 __pyx_v_suboffset = -1
L;
16607 __pyx_t_1 = __pyx_v_view->itemsize;
16608 __pyx_v_itemsize = __pyx_t_1;
16617 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16627 if (unlikely(__pyx_v_itemsize == 0)) {
16628 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16629 __PYX_ERR(1, 912, __pyx_L1_error)
16631 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16632 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16633 __PYX_ERR(1, 912, __pyx_L1_error)
16635 __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16644 __pyx_v_stride = __pyx_v_itemsize;
16664 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16673 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16682 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16692 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16712 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16722 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16731 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16732 if (unlikely(__pyx_t_2)) {
16741 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16742 __Pyx_GOTREF(__pyx_t_3);
16743 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 923, __pyx_L1_error)
16744 __Pyx_GOTREF(__pyx_t_4);
16745 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16746 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 923, __pyx_L1_error)
16747 __Pyx_GOTREF(__pyx_t_3);
16748 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16749 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16750 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16751 __PYX_ERR(1, 923, __pyx_L1_error)
16778 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16779 if (unlikely(__pyx_t_2)) {
16788 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
16789 __Pyx_GOTREF(__pyx_t_3);
16790 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 926, __pyx_L1_error)
16791 __Pyx_GOTREF(__pyx_t_4);
16792 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16793 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 926, __pyx_L1_error)
16794 __Pyx_GOTREF(__pyx_t_3);
16795 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16796 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16798 __PYX_ERR(1, 926, __pyx_L1_error)
16816 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16825 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16835 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16853 __pyx_r = __pyx_v_resultp;
16866 __Pyx_XDECREF(__pyx_t_3);
16867 __Pyx_XDECREF(__pyx_t_4);
16868 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16871 __Pyx_RefNannyFinishContext();
16883 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16885 Py_ssize_t *__pyx_v_shape;
16886 Py_ssize_t *__pyx_v_strides;
16891 Py_ssize_t *__pyx_t_2;
16894 Py_ssize_t __pyx_t_5;
16895 Py_ssize_t __pyx_t_6;
16907 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16908 __pyx_v_ndim = __pyx_t_1;
16917 __pyx_t_2 = __pyx_v_memslice->shape;
16918 __pyx_v_shape = __pyx_t_2;
16927 __pyx_t_2 = __pyx_v_memslice->strides;
16928 __pyx_v_strides = __pyx_t_2;
16937 __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16938 __pyx_t_4 = __pyx_t_3;
16939 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16940 __pyx_v_i = __pyx_t_1;
16949 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16958 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16959 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16960 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16961 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16970 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16971 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16972 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16973 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16982 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16985 __pyx_t_7 = __pyx_t_8;
16986 goto __pyx_L6_bool_binop_done;
16988 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16989 __pyx_t_7 = __pyx_t_8;
16990 __pyx_L6_bool_binop_done:;
17000 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 952, __pyx_L1_error)
17034 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17036 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17038 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17055 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
17056 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
17057 __Pyx_RefNannyDeclarations
17058 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
17059 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17062 __Pyx_RefNannyFinishContext();
17065 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17066 __Pyx_RefNannyDeclarations
17067 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
17076 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
17087 __Pyx_RefNannyFinishContext();
17098 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
17099 PyObject *__pyx_r = NULL;
17100 __Pyx_RefNannyDeclarations
17102 PyObject *__pyx_t_2 = NULL;
17103 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
17112 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
17122 __Pyx_XDECREF(__pyx_r);
17123 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 976, __pyx_L1_error)
17124 __Pyx_GOTREF(__pyx_t_2);
17125 __pyx_r = __pyx_t_2;
17146 __Pyx_XDECREF(__pyx_r);
17147 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 978, __pyx_L1_error)
17148 __Pyx_GOTREF(__pyx_t_2);
17149 __pyx_r = __pyx_t_2;
17164 __Pyx_XDECREF(__pyx_t_2);
17165 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17168 __Pyx_XGIVEREF(__pyx_r);
17169 __Pyx_RefNannyFinishContext();
17181 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
17182 PyObject *__pyx_r = NULL;
17183 __Pyx_RefNannyDeclarations
17186 PyObject *__pyx_t_3 = NULL;
17187 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
17196 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
17206 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 982, __pyx_L1_error)
17226 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 984, __pyx_L1_error)
17227 __Pyx_GOTREF(__pyx_t_3);
17228 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17241 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17244 __Pyx_XDECREF(__pyx_t_3);
17245 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
17248 __Pyx_XGIVEREF(__pyx_r);
17249 __Pyx_RefNannyFinishContext();
17262 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
17263 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
17264 PyObject *__pyx_r = 0;
17265 __Pyx_RefNannyDeclarations
17266 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
17267 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17270 __Pyx_RefNannyFinishContext();
17274 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17275 PyObject *__pyx_r = NULL;
17276 __Pyx_RefNannyDeclarations
17277 __Pyx_RefNannySetupContext(
"__get__", 0);
17286 __Pyx_XDECREF(__pyx_r);
17287 __Pyx_INCREF(__pyx_v_self->from_object);
17288 __pyx_r = __pyx_v_self->from_object;
17301 __Pyx_XGIVEREF(__pyx_r);
17302 __Pyx_RefNannyFinishContext();
17313 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
17314 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17315 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17316 PyObject *__pyx_r = 0;
17317 __Pyx_RefNannyDeclarations
17318 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
17319 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17322 __Pyx_RefNannyFinishContext();
17326 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17327 PyObject *__pyx_r = NULL;
17328 __Pyx_RefNannyDeclarations
17329 PyObject *__pyx_t_1 = NULL;
17330 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
17338 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
17339 __Pyx_GOTREF(__pyx_t_1);
17340 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17341 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17342 __PYX_ERR(1, 2, __pyx_L1_error)
17352 __Pyx_XDECREF(__pyx_t_1);
17353 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17355 __Pyx_XGIVEREF(__pyx_r);
17356 __Pyx_RefNannyFinishContext();
17368 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
17369 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17370 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17371 PyObject *__pyx_r = 0;
17372 __Pyx_RefNannyDeclarations
17373 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
17374 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17377 __Pyx_RefNannyFinishContext();
17381 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17382 PyObject *__pyx_r = NULL;
17383 __Pyx_RefNannyDeclarations
17384 PyObject *__pyx_t_1 = NULL;
17385 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
17392 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
17393 __Pyx_GOTREF(__pyx_t_1);
17394 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17395 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17396 __PYX_ERR(1, 4, __pyx_L1_error)
17407 __Pyx_XDECREF(__pyx_t_1);
17408 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17410 __Pyx_XGIVEREF(__pyx_r);
17411 __Pyx_RefNannyFinishContext();
17423 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
17424 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17425 Py_ssize_t __pyx_v_suboffset;
17426 PyObject *__pyx_v_length = NULL;
17427 PyObject *__pyx_r = NULL;
17428 __Pyx_RefNannyDeclarations
17430 PyObject *__pyx_t_2 = NULL;
17431 PyObject *__pyx_t_3 = NULL;
17432 __Pyx_TypeInfo *__pyx_t_4;
17433 Py_buffer __pyx_t_5;
17434 Py_ssize_t *__pyx_t_6;
17435 Py_ssize_t *__pyx_t_7;
17436 Py_ssize_t *__pyx_t_8;
17437 Py_ssize_t __pyx_t_9;
17438 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
17447 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17457 __Pyx_XDECREF(__pyx_r);
17458 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17477 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17478 __Pyx_GOTREF(__pyx_t_2);
17479 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1008, __pyx_L1_error)
17480 __Pyx_GOTREF(__pyx_t_3);
17481 __Pyx_INCREF(Py_None);
17482 __Pyx_GIVEREF(Py_None);
17483 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17484 __Pyx_INCREF(__pyx_int_0);
17485 __Pyx_GIVEREF(__pyx_int_0);
17486 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17487 __Pyx_GIVEREF(__pyx_t_2);
17488 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17490 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1008, __pyx_L1_error)
17491 __Pyx_GOTREF(__pyx_t_2);
17492 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17493 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17503 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17512 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17521 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17522 __Pyx_GOTREF(__pyx_t_2);
17523 __Pyx_GIVEREF(__pyx_t_2);
17524 __Pyx_GOTREF(__pyx_v_result->from_object);
17525 __Pyx_DECREF(__pyx_v_result->from_object);
17526 __pyx_v_result->from_object = __pyx_t_2;
17536 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17537 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17546 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17547 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17556 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17565 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17574 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17583 Py_INCREF(Py_None);
17592 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17602 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17622 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17633 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17642 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17651 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17660 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17661 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17662 __pyx_t_6 = __pyx_t_8;
17663 __pyx_v_suboffset = (__pyx_t_6[0]);
17672 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17682 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17691 goto __pyx_L6_break;
17711 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17712 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17721 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17722 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17723 __pyx_t_6 = __pyx_t_8;
17724 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1038, __pyx_L1_error)
17725 __Pyx_GOTREF(__pyx_t_2);
17726 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17736 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1039, __pyx_L1_error)
17737 __Pyx_GOTREF(__pyx_t_2);
17738 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1039, __pyx_L1_error)
17739 __Pyx_GOTREF(__pyx_t_3);
17740 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17741 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1039, __pyx_L1_error)
17742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17743 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17753 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17762 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17771 __Pyx_XDECREF(__pyx_r);
17772 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17773 __pyx_r = ((PyObject *)__pyx_v_result);
17786 __Pyx_XDECREF(__pyx_t_2);
17787 __Pyx_XDECREF(__pyx_t_3);
17788 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17791 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17792 __Pyx_XDECREF(__pyx_v_length);
17793 __Pyx_XGIVEREF(__pyx_r);
17794 __Pyx_RefNannyFinishContext();
17806 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17807 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17808 __Pyx_memviewslice *__pyx_r;
17809 __Pyx_RefNannyDeclarations
17812 PyObject *__pyx_t_3 = NULL;
17813 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17822 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17823 __pyx_t_2 = (__pyx_t_1 != 0);
17833 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1051, __pyx_L1_error)
17834 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17835 __Pyx_INCREF(__pyx_t_3);
17836 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17846 __pyx_r = (&__pyx_v_obj->from_slice);
17866 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17875 __pyx_r = __pyx_v_mslice;
17889 __Pyx_XDECREF(__pyx_t_3);
17890 __Pyx_WriteUnraisable(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17893 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17894 __Pyx_RefNannyFinishContext();
17906 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17908 Py_ssize_t *__pyx_v_shape;
17909 Py_ssize_t *__pyx_v_strides;
17910 Py_ssize_t *__pyx_v_suboffsets;
17911 __Pyx_RefNannyDeclarations
17912 Py_ssize_t *__pyx_t_1;
17916 Py_ssize_t __pyx_t_5;
17917 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17926 __pyx_t_1 = __pyx_v_memview->view.shape;
17927 __pyx_v_shape = __pyx_t_1;
17936 __pyx_t_1 = __pyx_v_memview->view.strides;
17937 __pyx_v_strides = __pyx_t_1;
17946 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17947 __pyx_v_suboffsets = __pyx_t_1;
17956 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17965 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17974 __pyx_t_2 = __pyx_v_memview->view.ndim;
17975 __pyx_t_3 = __pyx_t_2;
17976 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17977 __pyx_v_dim = __pyx_t_4;
17986 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17995 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
18004 if ((__pyx_v_suboffsets != 0)) {
18005 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
18009 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
18021 __Pyx_RefNannyFinishContext();
18032 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
18033 __Pyx_memviewslice __pyx_v_memviewslice;
18034 PyObject *__pyx_r = NULL;
18035 __Pyx_RefNannyDeclarations
18036 PyObject *__pyx_t_1 = NULL;
18037 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
18046 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
18055 __Pyx_XDECREF(__pyx_r);
18056 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1079, __pyx_L1_error)
18057 __Pyx_GOTREF(__pyx_t_1);
18058 __pyx_r = __pyx_t_1;
18072 __Pyx_XDECREF(__pyx_t_1);
18073 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
18076 __Pyx_XGIVEREF(__pyx_r);
18077 __Pyx_RefNannyFinishContext();
18089 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
18090 PyObject *(*__pyx_v_to_object_func)(
char *);
18091 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
18092 PyObject *__pyx_r = NULL;
18093 __Pyx_RefNannyDeclarations
18096 PyObject *(*__pyx_t_3)(
char *);
18097 int (*__pyx_t_4)(
char *, PyObject *);
18098 PyObject *__pyx_t_5 = NULL;
18099 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
18108 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18109 __pyx_t_2 = (__pyx_t_1 != 0);
18119 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
18120 __pyx_v_to_object_func = __pyx_t_3;
18129 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
18130 __pyx_v_to_dtype_func = __pyx_t_4;
18150 __pyx_v_to_object_func = NULL;
18159 __pyx_v_to_dtype_func = NULL;
18170 __Pyx_XDECREF(__pyx_r);
18179 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1096, __pyx_L1_error)
18180 __Pyx_GOTREF(__pyx_t_5);
18181 __pyx_r = __pyx_t_5;
18195 __Pyx_XDECREF(__pyx_t_5);
18196 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18199 __Pyx_XGIVEREF(__pyx_r);
18200 __Pyx_RefNannyFinishContext();
18212 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
18213 Py_ssize_t __pyx_r;
18223 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
18233 __pyx_r = (-__pyx_v_arg);
18253 __pyx_r = __pyx_v_arg;
18278 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
18280 Py_ssize_t __pyx_v_c_stride;
18281 Py_ssize_t __pyx_v_f_stride;
18295 __pyx_v_c_stride = 0;
18304 __pyx_v_f_stride = 0;
18313 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18314 __pyx_v_i = __pyx_t_1;
18323 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18333 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18342 goto __pyx_L4_break;
18362 __pyx_t_1 = __pyx_v_ndim;
18363 __pyx_t_3 = __pyx_t_1;
18364 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18365 __pyx_v_i = __pyx_t_4;
18374 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18384 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18393 goto __pyx_L7_break;
18413 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18468 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18469 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18470 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18471 Py_ssize_t __pyx_v_dst_extent;
18472 Py_ssize_t __pyx_v_src_stride;
18473 Py_ssize_t __pyx_v_dst_stride;
18477 Py_ssize_t __pyx_t_4;
18478 Py_ssize_t __pyx_t_5;
18479 Py_ssize_t __pyx_t_6;
18488 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18497 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18506 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18515 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18524 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18534 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18537 __pyx_t_1 = __pyx_t_2;
18538 goto __pyx_L5_bool_binop_done;
18540 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18543 __pyx_t_1 = __pyx_t_2;
18544 goto __pyx_L5_bool_binop_done;
18554 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18556 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18558 __pyx_t_3 = (__pyx_t_2 != 0);
18559 __pyx_t_1 = __pyx_t_3;
18560 __pyx_L5_bool_binop_done:;
18578 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18598 __pyx_t_4 = __pyx_v_dst_extent;
18599 __pyx_t_5 = __pyx_t_4;
18600 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18601 __pyx_v_i = __pyx_t_6;
18610 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18619 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18628 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18651 __pyx_t_4 = __pyx_v_dst_extent;
18652 __pyx_t_5 = __pyx_t_4;
18653 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18654 __pyx_v_i = __pyx_t_6;
18663 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18672 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18681 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18705 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18714 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18735 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18737 Py_ssize_t __pyx_v_size;
18738 Py_ssize_t __pyx_r;
18739 Py_ssize_t __pyx_t_1;
18751 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18752 __pyx_v_size = __pyx_t_1;
18761 __pyx_t_2 = __pyx_v_ndim;
18762 __pyx_t_3 = __pyx_t_2;
18763 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18764 __pyx_v_i = __pyx_t_4;
18773 __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
18783 __pyx_r = __pyx_v_size;
18807 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18809 Py_ssize_t __pyx_r;
18822 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18832 __pyx_t_2 = __pyx_v_ndim;
18833 __pyx_t_3 = __pyx_t_2;
18834 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18835 __pyx_v_idx = __pyx_t_4;
18844 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18853 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18874 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18875 __pyx_v_idx = __pyx_t_2;
18884 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18893 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18905 __pyx_r = __pyx_v_stride;
18929 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18931 void *__pyx_v_result;
18932 size_t __pyx_v_itemsize;
18933 size_t __pyx_v_size;
18935 Py_ssize_t __pyx_t_1;
18938 struct __pyx_memoryview_obj *__pyx_t_4;
18949 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18950 __pyx_v_itemsize = __pyx_t_1;
18959 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18968 __pyx_v_result = malloc(__pyx_v_size);
18977 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18987 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1220, __pyx_L1_error)
19005 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
19014 __pyx_t_4 = __pyx_v_src->memview;
19015 __pyx_v_tmpslice->memview = __pyx_t_4;
19024 __pyx_t_3 = __pyx_v_ndim;
19025 __pyx_t_5 = __pyx_t_3;
19026 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19027 __pyx_v_i = __pyx_t_6;
19036 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
19045 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1
L;
19055 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
19064 __pyx_t_3 = __pyx_v_ndim;
19065 __pyx_t_5 = __pyx_t_3;
19066 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19067 __pyx_v_i = __pyx_t_6;
19076 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
19086 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
19105 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
19115 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
19135 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
19146 __pyx_r = __pyx_v_result;
19161 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19163 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
19165 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19181 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
19183 __Pyx_RefNannyDeclarations
19184 PyObject *__pyx_t_1 = NULL;
19185 PyObject *__pyx_t_2 = NULL;
19186 PyObject *__pyx_t_3 = NULL;
19187 PyObject *__pyx_t_4 = NULL;
19189 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19191 __Pyx_RefNannySetupContext(
"_err_extents", 0);
19200 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1250, __pyx_L1_error)
19201 __Pyx_GOTREF(__pyx_t_1);
19202 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1250, __pyx_L1_error)
19203 __Pyx_GOTREF(__pyx_t_2);
19204 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1250, __pyx_L1_error)
19205 __Pyx_GOTREF(__pyx_t_3);
19206 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1250, __pyx_L1_error)
19207 __Pyx_GOTREF(__pyx_t_4);
19208 __Pyx_GIVEREF(__pyx_t_1);
19209 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
19210 __Pyx_GIVEREF(__pyx_t_2);
19211 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
19212 __Pyx_GIVEREF(__pyx_t_3);
19213 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
19225 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1249, __pyx_L1_error)
19226 __Pyx_GOTREF(__pyx_t_3);
19227 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19228 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
19229 __Pyx_GOTREF(__pyx_t_4);
19230 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19231 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19232 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19233 __PYX_ERR(1, 1249, __pyx_L1_error)
19245 __Pyx_XDECREF(__pyx_t_1);
19246 __Pyx_XDECREF(__pyx_t_2);
19247 __Pyx_XDECREF(__pyx_t_3);
19248 __Pyx_XDECREF(__pyx_t_4);
19249 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19251 __Pyx_RefNannyFinishContext();
19253 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19266 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
19268 __Pyx_RefNannyDeclarations
19269 PyObject *__pyx_t_1 = NULL;
19270 PyObject *__pyx_t_2 = NULL;
19271 PyObject *__pyx_t_3 = NULL;
19272 PyObject *__pyx_t_4 = NULL;
19273 PyObject *__pyx_t_5 = NULL;
19275 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19277 __Pyx_RefNannySetupContext(
"_err_dim", 0);
19278 __Pyx_INCREF(__pyx_v_error);
19287 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
19288 __Pyx_GOTREF(__pyx_t_2);
19289 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
19290 __Pyx_GOTREF(__pyx_t_3);
19291 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
19292 __Pyx_GOTREF(__pyx_t_4);
19293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19294 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19295 __Pyx_INCREF(__pyx_v_error);
19296 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19297 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19298 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19299 if (likely(__pyx_t_2)) {
19300 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19301 __Pyx_INCREF(__pyx_t_2);
19302 __Pyx_INCREF(
function);
19303 __Pyx_DECREF_SET(__pyx_t_3,
function);
19307 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19308 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19309 __Pyx_GOTREF(__pyx_t_1);
19311 #if CYTHON_FAST_PYCALL
19312 if (PyFunction_Check(__pyx_t_3)) {
19313 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19314 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19315 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19316 __Pyx_GOTREF(__pyx_t_1);
19317 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19320 #if CYTHON_FAST_PYCCALL
19321 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19322 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19323 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19324 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19325 __Pyx_GOTREF(__pyx_t_1);
19326 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19330 __pyx_t_5 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1254, __pyx_L1_error)
19331 __Pyx_GOTREF(__pyx_t_5);
19332 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
19333 __Pyx_GIVEREF(__pyx_t_4);
19334 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
19336 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
19337 __Pyx_GOTREF(__pyx_t_1);
19338 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19341 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19342 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19344 __PYX_ERR(1, 1254, __pyx_L1_error)
19356 __Pyx_XDECREF(__pyx_t_1);
19357 __Pyx_XDECREF(__pyx_t_2);
19358 __Pyx_XDECREF(__pyx_t_3);
19359 __Pyx_XDECREF(__pyx_t_4);
19360 __Pyx_XDECREF(__pyx_t_5);
19361 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19363 __Pyx_XDECREF(__pyx_v_error);
19364 __Pyx_RefNannyFinishContext();
19366 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19379 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19381 __Pyx_RefNannyDeclarations
19383 PyObject *__pyx_t_2 = NULL;
19384 PyObject *__pyx_t_3 = NULL;
19385 PyObject *__pyx_t_4 = NULL;
19386 PyObject *__pyx_t_5 = NULL;
19387 PyObject *__pyx_t_6 = NULL;
19389 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19391 __Pyx_RefNannySetupContext(
"_err", 0);
19392 __Pyx_INCREF(__pyx_v_error);
19401 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19402 if (unlikely(__pyx_t_1)) {
19411 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1259, __pyx_L1_error)
19412 __Pyx_GOTREF(__pyx_t_3);
19413 __Pyx_INCREF(__pyx_v_error);
19414 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19415 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19416 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19417 if (likely(__pyx_t_5)) {
19418 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19419 __Pyx_INCREF(__pyx_t_5);
19420 __Pyx_INCREF(
function);
19421 __Pyx_DECREF_SET(__pyx_t_4,
function);
19425 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19426 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19427 __Pyx_GOTREF(__pyx_t_2);
19429 #if CYTHON_FAST_PYCALL
19430 if (PyFunction_Check(__pyx_t_4)) {
19431 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19432 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19433 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19434 __Pyx_GOTREF(__pyx_t_2);
19435 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19438 #if CYTHON_FAST_PYCCALL
19439 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
19440 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19441 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19442 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19443 __Pyx_GOTREF(__pyx_t_2);
19444 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19448 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1259, __pyx_L1_error)
19449 __Pyx_GOTREF(__pyx_t_6);
19450 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
19451 __Pyx_GIVEREF(__pyx_t_3);
19452 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
19454 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1259, __pyx_L1_error)
19455 __Pyx_GOTREF(__pyx_t_2);
19456 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19459 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19460 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19461 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19462 __PYX_ERR(1, 1259, __pyx_L1_error)
19481 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19482 __PYX_ERR(1, 1261, __pyx_L1_error)
19495 __Pyx_XDECREF(__pyx_t_2);
19496 __Pyx_XDECREF(__pyx_t_3);
19497 __Pyx_XDECREF(__pyx_t_4);
19498 __Pyx_XDECREF(__pyx_t_5);
19499 __Pyx_XDECREF(__pyx_t_6);
19500 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19502 __Pyx_XDECREF(__pyx_v_error);
19503 __Pyx_RefNannyFinishContext();
19505 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19518 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19519 void *__pyx_v_tmpdata;
19520 size_t __pyx_v_itemsize;
19522 char __pyx_v_order;
19523 int __pyx_v_broadcasting;
19524 int __pyx_v_direct_copy;
19525 __Pyx_memviewslice __pyx_v_tmp;
19528 Py_ssize_t __pyx_t_1;
19544 __pyx_v_tmpdata = NULL;
19553 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19554 __pyx_v_itemsize = __pyx_t_1;
19563 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19572 __pyx_v_broadcasting = 0;
19581 __pyx_v_direct_copy = 0;
19590 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19600 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19619 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19629 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19648 __pyx_t_3 = __pyx_v_dst_ndim;
19649 __pyx_t_4 = __pyx_v_src_ndim;
19650 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19651 __pyx_t_5 = __pyx_t_3;
19653 __pyx_t_5 = __pyx_t_4;
19655 __pyx_v_ndim = __pyx_t_5;
19664 __pyx_t_5 = __pyx_v_ndim;
19665 __pyx_t_3 = __pyx_t_5;
19666 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19667 __pyx_v_i = __pyx_t_4;
19676 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19686 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19696 __pyx_v_broadcasting = 1;
19705 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19725 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1293, __pyx_L1_error)
19745 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19755 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1296, __pyx_L1_error)
19774 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19784 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19794 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19812 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1303, __pyx_L1_error)
19813 __pyx_v_tmpdata = __pyx_t_7;
19822 __pyx_v_src = __pyx_v_tmp;
19840 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19850 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19860 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19879 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19889 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19908 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19918 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19927 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19936 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19945 free(__pyx_v_tmpdata);
19982 __pyx_t_2 = (__pyx_v_order ==
'F');
19984 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19986 __pyx_t_8 = (__pyx_t_2 != 0);
19996 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1325, __pyx_L1_error)
20005 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1326, __pyx_L1_error)
20023 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20032 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
20041 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20050 free(__pyx_v_tmpdata);
20074 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20076 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
20078 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20094 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
20096 int __pyx_v_offset;
20108 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
20117 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
20118 __pyx_v_i = __pyx_t_1;
20127 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
20136 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
20145 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
20155 __pyx_t_1 = __pyx_v_offset;
20156 __pyx_t_2 = __pyx_t_1;
20157 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20158 __pyx_v_i = __pyx_t_3;
20167 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
20176 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
20185 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1
L;
20207 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
20217 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
20227 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
20257 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20258 __Pyx_RefNannyDeclarations
20260 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20262 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20271 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20282 __Pyx_RefNannyFinishContext();
20284 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20296 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20297 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20298 __Pyx_RefNannyDeclarations
20299 Py_ssize_t __pyx_t_1;
20300 Py_ssize_t __pyx_t_2;
20301 Py_ssize_t __pyx_t_3;
20303 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20312 __pyx_t_1 = (__pyx_v_shape[0]);
20313 __pyx_t_2 = __pyx_t_1;
20314 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20315 __pyx_v_i = __pyx_t_3;
20324 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20334 __pyx_t_4 = (__pyx_v_inc != 0);
20344 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20364 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20394 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20405 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20417 __Pyx_RefNannyFinishContext();
20428 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20437 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20446 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20455 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20476 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20477 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20478 Py_ssize_t __pyx_v_stride;
20479 Py_ssize_t __pyx_v_extent;
20481 Py_ssize_t __pyx_t_2;
20482 Py_ssize_t __pyx_t_3;
20483 Py_ssize_t __pyx_t_4;
20492 __pyx_v_stride = (__pyx_v_strides[0]);
20501 __pyx_v_extent = (__pyx_v_shape[0]);
20510 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20520 __pyx_t_2 = __pyx_v_extent;
20521 __pyx_t_3 = __pyx_t_2;
20522 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20523 __pyx_v_i = __pyx_t_4;
20532 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20541 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20562 __pyx_t_2 = __pyx_v_extent;
20563 __pyx_t_3 = __pyx_t_2;
20564 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20565 __pyx_v_i = __pyx_t_4;
20574 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20583 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20606 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20607 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20608 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20609 PyObject *__pyx_v___pyx_type = 0;
20610 long __pyx_v___pyx_checksum;
20611 PyObject *__pyx_v___pyx_state = 0;
20612 PyObject *__pyx_r = 0;
20613 __Pyx_RefNannyDeclarations
20614 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20616 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20617 PyObject* values[3] = {0,0,0};
20618 if (unlikely(__pyx_kwds)) {
20619 Py_ssize_t kw_args;
20620 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20621 switch (pos_args) {
20622 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20623 CYTHON_FALLTHROUGH;
20624 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20625 CYTHON_FALLTHROUGH;
20626 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20627 CYTHON_FALLTHROUGH;
20629 default:
goto __pyx_L5_argtuple_error;
20631 kw_args = PyDict_Size(__pyx_kwds);
20632 switch (pos_args) {
20634 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20635 else goto __pyx_L5_argtuple_error;
20636 CYTHON_FALLTHROUGH;
20638 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20640 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20642 CYTHON_FALLTHROUGH;
20644 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20646 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20649 if (unlikely(kw_args > 0)) {
20650 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20652 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20653 goto __pyx_L5_argtuple_error;
20655 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20656 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20657 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20659 __pyx_v___pyx_type = values[0];
20660 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20661 __pyx_v___pyx_state = values[2];
20663 goto __pyx_L4_argument_unpacking_done;
20664 __pyx_L5_argtuple_error:;
20665 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20667 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20668 __Pyx_RefNannyFinishContext();
20670 __pyx_L4_argument_unpacking_done:;
20671 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20674 __Pyx_RefNannyFinishContext();
20678 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20679 PyObject *__pyx_v___pyx_PickleError = NULL;
20680 PyObject *__pyx_v___pyx_result = NULL;
20681 PyObject *__pyx_r = NULL;
20682 __Pyx_RefNannyDeclarations
20684 PyObject *__pyx_t_2 = NULL;
20685 PyObject *__pyx_t_3 = NULL;
20686 PyObject *__pyx_t_4 = NULL;
20687 PyObject *__pyx_t_5 = NULL;
20688 PyObject *__pyx_t_6 = NULL;
20690 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20698 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20708 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20709 __Pyx_GOTREF(__pyx_t_2);
20710 __Pyx_INCREF(__pyx_n_s_PickleError);
20711 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20712 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20713 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
20714 __Pyx_GOTREF(__pyx_t_3);
20715 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20716 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
20717 __Pyx_GOTREF(__pyx_t_2);
20718 __Pyx_INCREF(__pyx_t_2);
20719 __pyx_v___pyx_PickleError = __pyx_t_2;
20720 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20721 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20730 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
20731 __Pyx_GOTREF(__pyx_t_2);
20732 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
20733 __Pyx_GOTREF(__pyx_t_4);
20734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20735 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20736 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20737 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20738 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20739 if (likely(__pyx_t_5)) {
20740 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20741 __Pyx_INCREF(__pyx_t_5);
20742 __Pyx_INCREF(
function);
20743 __Pyx_DECREF_SET(__pyx_t_2,
function);
20747 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20748 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20749 __Pyx_GOTREF(__pyx_t_3);
20751 #if CYTHON_FAST_PYCALL
20752 if (PyFunction_Check(__pyx_t_2)) {
20753 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20754 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20755 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20756 __Pyx_GOTREF(__pyx_t_3);
20757 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20760 #if CYTHON_FAST_PYCCALL
20761 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20762 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20763 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20764 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20765 __Pyx_GOTREF(__pyx_t_3);
20766 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20770 __pyx_t_6 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
20771 __Pyx_GOTREF(__pyx_t_6);
20772 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
20773 __Pyx_GIVEREF(__pyx_t_4);
20774 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
20776 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
20777 __Pyx_GOTREF(__pyx_t_3);
20778 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20781 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20782 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20783 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20784 __PYX_ERR(1, 4, __pyx_L1_error)
20801 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20802 __Pyx_GOTREF(__pyx_t_2);
20804 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20805 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
20806 if (likely(__pyx_t_6)) {
20807 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20808 __Pyx_INCREF(__pyx_t_6);
20809 __Pyx_INCREF(
function);
20810 __Pyx_DECREF_SET(__pyx_t_2,
function);
20814 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20815 __Pyx_GOTREF(__pyx_t_3);
20817 #if CYTHON_FAST_PYCALL
20818 if (PyFunction_Check(__pyx_t_2)) {
20819 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20820 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20821 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20822 __Pyx_GOTREF(__pyx_t_3);
20825 #if CYTHON_FAST_PYCCALL
20826 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20827 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20828 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20829 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20830 __Pyx_GOTREF(__pyx_t_3);
20834 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
20835 __Pyx_GOTREF(__pyx_t_4);
20836 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
20837 __Pyx_INCREF(__pyx_v___pyx_type);
20838 __Pyx_GIVEREF(__pyx_v___pyx_type);
20839 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
20840 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20841 __Pyx_GOTREF(__pyx_t_3);
20842 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20845 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20846 __pyx_v___pyx_result = __pyx_t_3;
20856 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20857 __pyx_t_7 = (__pyx_t_1 != 0);
20867 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
20868 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20869 __Pyx_GOTREF(__pyx_t_3);
20870 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20888 __Pyx_XDECREF(__pyx_r);
20889 __Pyx_INCREF(__pyx_v___pyx_result);
20890 __pyx_r = __pyx_v___pyx_result;
20901 __Pyx_XDECREF(__pyx_t_2);
20902 __Pyx_XDECREF(__pyx_t_3);
20903 __Pyx_XDECREF(__pyx_t_4);
20904 __Pyx_XDECREF(__pyx_t_5);
20905 __Pyx_XDECREF(__pyx_t_6);
20906 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20909 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20910 __Pyx_XDECREF(__pyx_v___pyx_result);
20911 __Pyx_XGIVEREF(__pyx_r);
20912 __Pyx_RefNannyFinishContext();
20924 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20925 PyObject *__pyx_r = NULL;
20926 __Pyx_RefNannyDeclarations
20927 PyObject *__pyx_t_1 = NULL;
20929 Py_ssize_t __pyx_t_3;
20932 PyObject *__pyx_t_6 = NULL;
20933 PyObject *__pyx_t_7 = NULL;
20934 PyObject *__pyx_t_8 = NULL;
20935 PyObject *__pyx_t_9 = NULL;
20936 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20945 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20946 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20947 __PYX_ERR(1, 10, __pyx_L1_error)
20949 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
20950 __Pyx_GOTREF(__pyx_t_1);
20951 __Pyx_GIVEREF(__pyx_t_1);
20952 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20953 __Pyx_DECREF(__pyx_v___pyx_result->name);
20954 __pyx_v___pyx_result->name = __pyx_t_1;
20963 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20964 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20965 __PYX_ERR(1, 11, __pyx_L1_error)
20967 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
20968 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20971 __pyx_t_2 = __pyx_t_4;
20972 goto __pyx_L4_bool_binop_done;
20974 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
20975 __pyx_t_5 = (__pyx_t_4 != 0);
20976 __pyx_t_2 = __pyx_t_5;
20977 __pyx_L4_bool_binop_done:;
20985 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
20986 __Pyx_GOTREF(__pyx_t_6);
20987 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
20988 __Pyx_GOTREF(__pyx_t_7);
20989 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20990 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20991 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20992 __PYX_ERR(1, 12, __pyx_L1_error)
20994 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
20995 __Pyx_GOTREF(__pyx_t_6);
20997 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20998 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20999 if (likely(__pyx_t_8)) {
21000 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
21001 __Pyx_INCREF(__pyx_t_8);
21002 __Pyx_INCREF(
function);
21003 __Pyx_DECREF_SET(__pyx_t_7,
function);
21007 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21008 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21009 __Pyx_GOTREF(__pyx_t_1);
21011 #if CYTHON_FAST_PYCALL
21012 if (PyFunction_Check(__pyx_t_7)) {
21013 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21014 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21015 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21016 __Pyx_GOTREF(__pyx_t_1);
21017 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21020 #if CYTHON_FAST_PYCCALL
21021 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
21022 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
21023 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21024 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
21025 __Pyx_GOTREF(__pyx_t_1);
21026 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21030 __pyx_t_9 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
21031 __Pyx_GOTREF(__pyx_t_9);
21032 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
21033 __Pyx_GIVEREF(__pyx_t_6);
21034 PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
21036 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
21037 __Pyx_GOTREF(__pyx_t_1);
21038 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21041 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21061 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21064 __Pyx_XDECREF(__pyx_t_1);
21065 __Pyx_XDECREF(__pyx_t_6);
21066 __Pyx_XDECREF(__pyx_t_7);
21067 __Pyx_XDECREF(__pyx_t_8);
21068 __Pyx_XDECREF(__pyx_t_9);
21069 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
21072 __Pyx_XGIVEREF(__pyx_r);
21073 __Pyx_RefNannyFinishContext();
21077 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21078 struct __pyx_obj_18BoundaryConditions_BC_Base *p;
21080 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21081 o = (*t->tp_alloc)(t, 0);
21083 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21085 if (unlikely(!o))
return 0;
21086 p = ((
struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
21087 p->Shape = Py_None; Py_INCREF(Py_None);
21088 p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
21089 p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
21090 p->ct = Py_None; Py_INCREF(Py_None);
21091 p->_b_or.data = NULL;
21092 p->_b_or.memview = NULL;
21096 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
21097 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21098 #if CYTHON_USE_TP_FINALIZE
21099 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21100 if (PyObject_CallFinalizerFromDealloc(o))
return;
21103 PyObject_GC_UnTrack(o);
21104 Py_CLEAR(p->Shape);
21106 Py_CLEAR(p->BC_type);
21108 __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
21109 (*Py_TYPE(o)->tp_free)(o);
21112 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc
v,
void *a) {
21114 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21116 e = (*v)(p->Shape, a);
if (e)
return e;
21119 e = (*v)(p->ct, a);
if (e)
return e;
21124 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
21126 struct __pyx_obj_18BoundaryConditions_BC_Base *p = (
struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
21127 tmp = ((PyObject*)p->Shape);
21128 p->Shape = Py_None; Py_INCREF(Py_None);
21130 tmp = ((PyObject*)p->ct);
21131 p->ct = Py_None; Py_INCREF(Py_None);
21136 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED
void *x) {
21137 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
21140 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21142 return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o,
v);
21145 PyErr_SetString(PyExc_NotImplementedError,
"__del__");
21150 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED
void *x) {
21151 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
21154 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21156 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o,
v);
21159 return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
21163 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED
void *x) {
21164 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
21167 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21169 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o,
v);
21172 return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
21176 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED
void *x) {
21177 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
21180 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21182 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o,
v);
21185 return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
21189 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED
void *x) {
21190 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
21193 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21195 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o,
v);
21198 return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
21202 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
21203 {
"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
21204 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0},
21205 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0},
21209 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
21210 {(
char *)
"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (
char *)0, 0},
21211 {(
char *)
"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (
char *)0, 0},
21212 {(
char *)
"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (
char *)0, 0},
21213 {(
char *)
"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (
char *)0, 0},
21214 {(
char *)
"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (
char *)0, 0},
21218 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
21219 PyVarObject_HEAD_INIT(0, 0)
21220 "BoundaryConditions.BC_Base",
21221 sizeof(
struct __pyx_obj_18BoundaryConditions_BC_Base),
21223 __pyx_tp_dealloc_18BoundaryConditions_BC_Base,
21227 #if PY_MAJOR_VERSION < 3
21230 #if PY_MAJOR_VERSION >= 3
21243 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21244 "\n Generic class regrouping boundary conditions\n ",
21245 __pyx_tp_traverse_18BoundaryConditions_BC_Base,
21246 __pyx_tp_clear_18BoundaryConditions_BC_Base,
21251 __pyx_methods_18BoundaryConditions_BC_Base,
21253 __pyx_getsets_18BoundaryConditions_BC_Base,
21259 __pyx_pw_18BoundaryConditions_7BC_Base_1__init__,
21261 __pyx_tp_new_18BoundaryConditions_BC_Base,
21271 #if PY_VERSION_HEX >= 0x030400a1
21275 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
21277 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21278 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
21280 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21281 o = (*t->tp_alloc)(t, 0);
21283 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21285 if (unlikely(!o))
return 0;
21286 p = ((
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
21287 p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
21288 p->uOfXT = Py_None; Py_INCREF(Py_None);
21292 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21293 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21294 #if CYTHON_USE_TP_FINALIZE
21295 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21296 if (PyObject_CallFinalizerFromDealloc(o))
return;
21299 PyObject_GC_UnTrack(o);
21300 Py_CLEAR(p->uOfXT);
21301 (*Py_TYPE(o)->tp_free)(o);
21304 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc
v,
void *a) {
21306 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21308 e = (*v)(p->uOfXT, a);
if (e)
return e;
21313 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21315 struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21316 tmp = ((PyObject*)p->uOfXT);
21317 p->uOfXT = Py_None; Py_INCREF(Py_None);
21322 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED
void *x) {
21323 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21326 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *
v, CYTHON_UNUSED
void *x) {
21328 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o,
v);
21331 return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21335 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21336 {
"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0},
21337 {
"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21338 {
"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_8setLinearBC},
21339 {
"setLinearRamp", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_17BoundaryCondition_10setLinearRamp},
21340 {
"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, METH_NOARGS, 0},
21341 {
"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, METH_O, 0},
21345 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21346 {(
char *)
"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (
char *)0, 0},
21350 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21351 PyVarObject_HEAD_INIT(0, 0)
21352 "BoundaryConditions.BoundaryCondition",
21353 sizeof(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition),
21355 __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition,
21359 #if PY_MAJOR_VERSION < 3
21362 #if PY_MAJOR_VERSION >= 3
21375 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21376 "\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ",
21377 __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition,
21378 __pyx_tp_clear_18BoundaryConditions_BoundaryCondition,
21383 __pyx_methods_18BoundaryConditions_BoundaryCondition,
21385 __pyx_getsets_18BoundaryConditions_BoundaryCondition,
21391 __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__,
21393 __pyx_tp_new_18BoundaryConditions_BoundaryCondition,
21403 #if PY_VERSION_HEX >= 0x030400a1
21408 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21409 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21411 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21413 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21414 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21415 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21416 (void) PyObject_INIT(o, t);
21417 PyObject_GC_Track(o);
21419 o = (*t->tp_alloc)(t, 0);
21420 if (unlikely(!o))
return 0;
21425 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21426 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21427 PyObject_GC_UnTrack(o);
21428 Py_CLEAR(p->__pyx_v_value);
21429 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21430 __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21432 (*Py_TYPE(o)->tp_free)(o);
21436 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc
v,
void *a) {
21438 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21439 if (p->__pyx_v_value) {
21440 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21445 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21447 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21448 tmp = ((PyObject*)p->__pyx_v_value);
21449 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21454 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21455 PyVarObject_HEAD_INIT(0, 0)
21456 "BoundaryConditions.__pyx_scope_struct__setConstantBC",
21457 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC),
21459 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21463 #if PY_MAJOR_VERSION < 3
21466 #if PY_MAJOR_VERSION >= 3
21479 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21481 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21482 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21497 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC,
21507 #if PY_VERSION_HEX >= 0x030400a1
21512 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21513 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21515 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21517 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21518 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21519 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21520 (void) PyObject_INIT(o, t);
21521 PyObject_GC_Track(o);
21523 o = (*t->tp_alloc)(t, 0);
21524 if (unlikely(!o))
return 0;
21529 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21530 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21531 PyObject_GC_UnTrack(o);
21532 Py_CLEAR(p->__pyx_v_a);
21533 Py_CLEAR(p->__pyx_v_a0);
21534 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21535 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21537 (*Py_TYPE(o)->tp_free)(o);
21541 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc
v,
void *a) {
21543 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21544 if (p->__pyx_v_a) {
21545 e = (*v)(p->__pyx_v_a, a);
if (e)
return e;
21547 if (p->__pyx_v_a0) {
21548 e = (*v)(p->__pyx_v_a0, a);
if (e)
return e;
21553 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21555 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21556 tmp = ((PyObject*)p->__pyx_v_a);
21557 p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
21559 tmp = ((PyObject*)p->__pyx_v_a0);
21560 p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21565 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21566 PyVarObject_HEAD_INIT(0, 0)
21567 "BoundaryConditions.__pyx_scope_struct_1_setLinearBC",
21568 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC),
21570 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21574 #if PY_MAJOR_VERSION < 3
21577 #if PY_MAJOR_VERSION >= 3
21590 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21592 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21593 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21608 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC,
21618 #if PY_VERSION_HEX >= 0x030400a1
21623 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[8];
21624 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = 0;
21626 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21628 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp > 0) & (t->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21629 o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp];
21630 memset(o, 0,
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp));
21631 (void) PyObject_INIT(o, t);
21632 PyObject_GC_Track(o);
21634 o = (*t->tp_alloc)(t, 0);
21635 if (unlikely(!o))
return 0;
21640 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21641 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21642 PyObject_GC_UnTrack(o);
21643 Py_CLEAR(p->__pyx_v_t1);
21644 Py_CLEAR(p->__pyx_v_value);
21645 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp < 8) & (Py_TYPE(o)->tp_basicsize ==
sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp)))) {
21646 __pyx_freelist_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp++] = ((
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o);
21648 (*Py_TYPE(o)->tp_free)(o);
21652 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o, visitproc
v,
void *a) {
21654 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21655 if (p->__pyx_v_t1) {
21656 e = (*v)(p->__pyx_v_t1, a);
if (e)
return e;
21658 if (p->__pyx_v_value) {
21659 e = (*v)(p->__pyx_v_value, a);
if (e)
return e;
21664 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp(PyObject *o) {
21666 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *p = (
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp *)o;
21667 tmp = ((PyObject*)p->__pyx_v_t1);
21668 p->__pyx_v_t1 = Py_None; Py_INCREF(Py_None);
21670 tmp = ((PyObject*)p->__pyx_v_value);
21671 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21676 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = {
21677 PyVarObject_HEAD_INIT(0, 0)
21678 "BoundaryConditions.__pyx_scope_struct_2_setLinearRamp",
21679 sizeof(
struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp),
21681 __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21685 #if PY_MAJOR_VERSION < 3
21688 #if PY_MAJOR_VERSION >= 3
21701 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
21703 __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21704 __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21719 __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp,
21729 #if PY_VERSION_HEX >= 0x030400a1
21733 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21735 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21736 struct __pyx_array_obj *p;
21738 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21739 o = (*t->tp_alloc)(t, 0);
21741 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21743 if (unlikely(!o))
return 0;
21744 p = ((
struct __pyx_array_obj *)o);
21745 p->__pyx_vtab = __pyx_vtabptr_array;
21746 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21747 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21748 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
21751 Py_DECREF(o); o = 0;
21755 static void __pyx_tp_dealloc_array(PyObject *o) {
21756 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
21757 #if CYTHON_USE_TP_FINALIZE
21758 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21759 if (PyObject_CallFinalizerFromDealloc(o))
return;
21763 PyObject *etype, *eval, *etb;
21764 PyErr_Fetch(&etype, &eval, &etb);
21766 __pyx_array___dealloc__(o);
21768 PyErr_Restore(etype, eval, etb);
21771 Py_CLEAR(p->_format);
21772 (*Py_TYPE(o)->tp_free)(o);
21774 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21776 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21777 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21782 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *
v) {
21784 return __pyx_array___setitem__(o, i,
v);
21787 PyErr_Format(PyExc_NotImplementedError,
21788 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21793 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *
n) {
21794 PyObject *
v = __Pyx_PyObject_GenericGetAttr(o,
n);
21795 if (!
v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21797 v = __pyx_array___getattr__(o,
n);
21802 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21803 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21806 static PyMethodDef __pyx_methods_array[] = {
21807 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21808 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21809 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21813 static struct PyGetSetDef __pyx_getsets_array[] = {
21814 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21818 static PySequenceMethods __pyx_tp_as_sequence_array = {
21819 __pyx_array___len__,
21822 __pyx_sq_item_array,
21831 static PyMappingMethods __pyx_tp_as_mapping_array = {
21832 __pyx_array___len__,
21833 __pyx_array___getitem__,
21834 __pyx_mp_ass_subscript_array,
21837 static PyBufferProcs __pyx_tp_as_buffer_array = {
21838 #if PY_MAJOR_VERSION < 3
21841 #if PY_MAJOR_VERSION < 3
21844 #if PY_MAJOR_VERSION < 3
21847 #if PY_MAJOR_VERSION < 3
21850 __pyx_array_getbuffer,
21854 static PyTypeObject __pyx_type___pyx_array = {
21855 PyVarObject_HEAD_INIT(0, 0)
21856 "BoundaryConditions.array",
21857 sizeof(
struct __pyx_array_obj),
21859 __pyx_tp_dealloc_array,
21863 #if PY_MAJOR_VERSION < 3
21866 #if PY_MAJOR_VERSION >= 3
21871 &__pyx_tp_as_sequence_array,
21872 &__pyx_tp_as_mapping_array,
21876 __pyx_tp_getattro_array,
21878 &__pyx_tp_as_buffer_array,
21879 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21887 __pyx_methods_array,
21889 __pyx_getsets_array,
21897 __pyx_tp_new_array,
21907 #if PY_VERSION_HEX >= 0x030400a1
21912 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21913 struct __pyx_MemviewEnum_obj *p;
21915 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21916 o = (*t->tp_alloc)(t, 0);
21918 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21920 if (unlikely(!o))
return 0;
21921 p = ((
struct __pyx_MemviewEnum_obj *)o);
21922 p->name = Py_None; Py_INCREF(Py_None);
21926 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21927 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21928 #if CYTHON_USE_TP_FINALIZE
21929 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21930 if (PyObject_CallFinalizerFromDealloc(o))
return;
21933 PyObject_GC_UnTrack(o);
21935 (*Py_TYPE(o)->tp_free)(o);
21938 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc
v,
void *a) {
21940 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21942 e = (*v)(p->name, a);
if (e)
return e;
21947 static int __pyx_tp_clear_Enum(PyObject *o) {
21949 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21950 tmp = ((PyObject*)p->name);
21951 p->name = Py_None; Py_INCREF(Py_None);
21956 static PyMethodDef __pyx_methods_Enum[] = {
21957 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21958 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21962 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21963 PyVarObject_HEAD_INIT(0, 0)
21964 "BoundaryConditions.Enum",
21965 sizeof(
struct __pyx_MemviewEnum_obj),
21967 __pyx_tp_dealloc_Enum,
21971 #if PY_MAJOR_VERSION < 3
21974 #if PY_MAJOR_VERSION >= 3
21977 __pyx_MemviewEnum___repr__,
21987 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21989 __pyx_tp_traverse_Enum,
21990 __pyx_tp_clear_Enum,
21995 __pyx_methods_Enum,
22003 __pyx_MemviewEnum___init__,
22015 #if PY_VERSION_HEX >= 0x030400a1
22019 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
22021 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
22022 struct __pyx_memoryview_obj *p;
22024 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
22025 o = (*t->tp_alloc)(t, 0);
22027 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
22029 if (unlikely(!o))
return 0;
22030 p = ((
struct __pyx_memoryview_obj *)o);
22031 p->__pyx_vtab = __pyx_vtabptr_memoryview;
22032 p->obj = Py_None; Py_INCREF(Py_None);
22033 p->_size = Py_None; Py_INCREF(Py_None);
22034 p->_array_interface = Py_None; Py_INCREF(Py_None);
22035 p->view.obj = NULL;
22036 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
22039 Py_DECREF(o); o = 0;
22043 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
22044 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22045 #if CYTHON_USE_TP_FINALIZE
22046 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22047 if (PyObject_CallFinalizerFromDealloc(o))
return;
22050 PyObject_GC_UnTrack(o);
22052 PyObject *etype, *eval, *etb;
22053 PyErr_Fetch(&etype, &eval, &etb);
22055 __pyx_memoryview___dealloc__(o);
22057 PyErr_Restore(etype, eval, etb);
22060 Py_CLEAR(p->_size);
22061 Py_CLEAR(p->_array_interface);
22062 (*Py_TYPE(o)->tp_free)(o);
22065 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc
v,
void *a) {
22067 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22069 e = (*v)(p->obj, a);
if (e)
return e;
22072 e = (*v)(p->_size, a);
if (e)
return e;
22074 if (p->_array_interface) {
22075 e = (*v)(p->_array_interface, a);
if (e)
return e;
22078 e = (*v)(p->view.obj, a);
if (e)
return e;
22083 static int __pyx_tp_clear_memoryview(PyObject *o) {
22085 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
22086 tmp = ((PyObject*)p->obj);
22087 p->obj = Py_None; Py_INCREF(Py_None);
22089 tmp = ((PyObject*)p->_size);
22090 p->_size = Py_None; Py_INCREF(Py_None);
22092 tmp = ((PyObject*)p->_array_interface);
22093 p->_array_interface = Py_None; Py_INCREF(Py_None);
22095 Py_CLEAR(p->view.obj);
22098 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
22100 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
22101 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
22106 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *
v) {
22108 return __pyx_memoryview___setitem__(o, i,
v);
22111 PyErr_Format(PyExc_NotImplementedError,
22112 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
22117 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
22118 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
22121 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
22122 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
22125 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
22126 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
22129 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
22130 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
22133 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
22134 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
22137 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
22138 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
22141 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
22142 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
22145 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
22146 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
22149 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
22150 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
22153 static PyMethodDef __pyx_methods_memoryview[] = {
22154 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
22155 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
22156 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
22157 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
22158 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
22159 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
22163 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
22164 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
22165 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
22166 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
22167 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
22168 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
22169 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
22170 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
22171 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
22172 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
22176 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
22177 __pyx_memoryview___len__,
22180 __pyx_sq_item_memoryview,
22189 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
22190 __pyx_memoryview___len__,
22191 __pyx_memoryview___getitem__,
22192 __pyx_mp_ass_subscript_memoryview,
22195 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
22196 #if PY_MAJOR_VERSION < 3
22199 #if PY_MAJOR_VERSION < 3
22202 #if PY_MAJOR_VERSION < 3
22205 #if PY_MAJOR_VERSION < 3
22208 __pyx_memoryview_getbuffer,
22212 static PyTypeObject __pyx_type___pyx_memoryview = {
22213 PyVarObject_HEAD_INIT(0, 0)
22214 "BoundaryConditions.memoryview",
22215 sizeof(
struct __pyx_memoryview_obj),
22217 __pyx_tp_dealloc_memoryview,
22221 #if PY_MAJOR_VERSION < 3
22224 #if PY_MAJOR_VERSION >= 3
22227 __pyx_memoryview___repr__,
22229 &__pyx_tp_as_sequence_memoryview,
22230 &__pyx_tp_as_mapping_memoryview,
22233 __pyx_memoryview___str__,
22236 &__pyx_tp_as_buffer_memoryview,
22237 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22239 __pyx_tp_traverse_memoryview,
22240 __pyx_tp_clear_memoryview,
22245 __pyx_methods_memoryview,
22247 __pyx_getsets_memoryview,
22255 __pyx_tp_new_memoryview,
22265 #if PY_VERSION_HEX >= 0x030400a1
22269 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
22271 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
22272 struct __pyx_memoryviewslice_obj *p;
22273 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
22274 if (unlikely(!o))
return 0;
22275 p = ((
struct __pyx_memoryviewslice_obj *)o);
22276 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
22277 p->from_object = Py_None; Py_INCREF(Py_None);
22278 p->from_slice.memview = NULL;
22282 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
22283 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22284 #if CYTHON_USE_TP_FINALIZE
22285 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
22286 if (PyObject_CallFinalizerFromDealloc(o))
return;
22289 PyObject_GC_UnTrack(o);
22291 PyObject *etype, *eval, *etb;
22292 PyErr_Fetch(&etype, &eval, &etb);
22294 __pyx_memoryviewslice___dealloc__(o);
22296 PyErr_Restore(etype, eval, etb);
22298 Py_CLEAR(p->from_object);
22299 PyObject_GC_Track(o);
22300 __pyx_tp_dealloc_memoryview(o);
22303 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc
v,
void *a) {
22305 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22306 e = __pyx_tp_traverse_memoryview(o,
v, a);
if (e)
return e;
22307 if (p->from_object) {
22308 e = (*v)(p->from_object, a);
if (e)
return e;
22313 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
22315 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
22316 __pyx_tp_clear_memoryview(o);
22317 tmp = ((PyObject*)p->from_object);
22318 p->from_object = Py_None; Py_INCREF(Py_None);
22320 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
22324 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
22325 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
22328 static PyMethodDef __pyx_methods__memoryviewslice[] = {
22329 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
22330 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
22334 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
22335 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
22339 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
22340 PyVarObject_HEAD_INIT(0, 0)
22341 "BoundaryConditions._memoryviewslice",
22342 sizeof(
struct __pyx_memoryviewslice_obj),
22344 __pyx_tp_dealloc__memoryviewslice,
22348 #if PY_MAJOR_VERSION < 3
22351 #if PY_MAJOR_VERSION >= 3
22354 #if CYTHON_COMPILING_IN_PYPY
22355 __pyx_memoryview___repr__,
22364 #if CYTHON_COMPILING_IN_PYPY
22365 __pyx_memoryview___str__,
22372 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
22373 "Internal class for passing memoryview slices to Python",
22374 __pyx_tp_traverse__memoryviewslice,
22375 __pyx_tp_clear__memoryviewslice,
22380 __pyx_methods__memoryviewslice,
22382 __pyx_getsets__memoryviewslice,
22390 __pyx_tp_new__memoryviewslice,
22400 #if PY_VERSION_HEX >= 0x030400a1
22405 static PyMethodDef __pyx_methods[] = {
22409 #if PY_MAJOR_VERSION >= 3
22410 #if CYTHON_PEP489_MULTI_PHASE_INIT
22411 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
22412 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module);
22413 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22414 {Py_mod_create, (
void*)__pyx_pymod_create},
22415 {Py_mod_exec, (
void*)__pyx_pymod_exec_BoundaryConditions},
22420 static struct PyModuleDef __pyx_moduledef = {
22421 PyModuleDef_HEAD_INIT,
22422 "BoundaryConditions",
22424 #if CYTHON_PEP489_MULTI_PHASE_INIT
22430 #if CYTHON_PEP489_MULTI_PHASE_INIT
22431 __pyx_moduledef_slots,
22441 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22442 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22443 {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython,
sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22444 {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython,
sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22445 {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext,
sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22446 {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho,
sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22447 {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt,
sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22448 {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython,
sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22449 {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC,
sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22450 {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC,
sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22451 {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC,
sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22452 {&__pyx_n_s_BoundaryCondition_setLinearRamp, __pyx_k_BoundaryCondition_setLinearRamp,
sizeof(__pyx_k_BoundaryCondition_setLinearRamp), 0, 0, 1, 1},
22453 {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions,
sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22454 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22455 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22456 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22457 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22458 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22459 {&__pyx_n_s_Context, __pyx_k_Context,
sizeof(__pyx_k_Context), 0, 0, 1, 1},
22460 {&__pyx_n_s_Domain, __pyx_k_Domain,
sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22461 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22462 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22463 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22464 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22465 {&__pyx_n_s_ImportError, __pyx_k_ImportError,
sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22466 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
22467 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22468 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22469 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22470 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22471 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22472 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22473 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22474 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22475 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22476 {&__pyx_n_s_None, __pyx_k_None,
sizeof(__pyx_k_None), 0, 0, 1, 1},
22477 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
22478 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22479 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22480 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22481 {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC,
sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22482 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22483 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22484 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22485 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22486 {&__pyx_n_s_a, __pyx_k_a,
sizeof(__pyx_k_a), 0, 0, 1, 1},
22487 {&__pyx_n_s_a0, __pyx_k_a0,
sizeof(__pyx_k_a0), 0, 0, 1, 1},
22488 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22489 {&__pyx_n_s_b_i, __pyx_k_b_i,
sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22490 {&__pyx_n_s_b_or, __pyx_k_b_or,
sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22491 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
22492 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
22493 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
22494 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
22495 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22496 {&__pyx_n_s_context, __pyx_k_context,
sizeof(__pyx_k_context), 0, 0, 1, 1},
22497 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22498 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22499 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
22500 {&__pyx_n_s_dict_2, __pyx_k_dict_2,
sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22501 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22502 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
22503 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22504 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
22505 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
22506 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
22507 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22508 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22509 {&__pyx_n_s_get, __pyx_k_get,
sizeof(__pyx_k_get), 0, 0, 1, 1},
22510 {&__pyx_n_s_getContext, __pyx_k_getContext,
sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22511 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22512 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22513 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
22514 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22515 {&__pyx_n_s_init_cython, __pyx_k_init_cython,
sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22516 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22517 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22518 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22519 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
22520 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
22521 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
22522 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22523 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22524 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22525 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22526 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22527 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
22528 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22529 {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to,
sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22530 {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor,
sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22531 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
22532 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
22533 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22534 {&__pyx_n_s_proteus, __pyx_k_proteus,
sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22535 {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py,
sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22536 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22537 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22538 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22539 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22540 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22541 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22542 {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base,
sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22543 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22544 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22545 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22546 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22547 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22548 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22549 {&__pyx_n_s_resetBC, __pyx_k_resetBC,
sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22550 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
22551 {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted,
sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22552 {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC,
sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22553 {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda,
sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22554 {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC,
sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22555 {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda,
sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22556 {&__pyx_n_s_setLinearRamp, __pyx_k_setLinearRamp,
sizeof(__pyx_k_setLinearRamp), 0, 0, 1, 1},
22557 {&__pyx_n_s_setLinearRamp_locals_lambda, __pyx_k_setLinearRamp_locals_lambda,
sizeof(__pyx_k_setLinearRamp_locals_lambda), 0, 0, 1, 1},
22558 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22559 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22560 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22561 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
22562 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
22563 {&__pyx_n_s_state, __pyx_k_state,
sizeof(__pyx_k_state), 0, 0, 1, 1},
22564 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
22565 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
22566 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22567 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22568 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22569 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22570 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
22571 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22572 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22573 {&__pyx_n_s_t1, __pyx_k_t1,
sizeof(__pyx_k_t1), 0, 0, 1, 1},
22574 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22575 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22576 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22577 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22578 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22579 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
22580 {&__pyx_n_s_use_setstate, __pyx_k_use_setstate,
sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22581 {&__pyx_n_s_value, __pyx_k_value,
sizeof(__pyx_k_value), 0, 0, 1, 1},
22582 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22583 {0, 0, 0, 0, 0, 0, 0}
22585 static int __Pyx_InitCachedBuiltins(
void) {
22586 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum);
if (!__pyx_builtin_sum) __PYX_ERR(0, 102, __pyx_L1_error)
22587 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
22588 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(3, 229, __pyx_L1_error)
22589 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(3, 242, __pyx_L1_error)
22590 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 810, __pyx_L1_error)
22591 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError);
if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1000, __pyx_L1_error)
22592 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 147, __pyx_L1_error)
22593 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 150, __pyx_L1_error)
22594 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 399, __pyx_L1_error)
22595 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 608, __pyx_L1_error)
22596 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 827, __pyx_L1_error)
22602 static int __Pyx_InitCachedConstants(
void) {
22603 __Pyx_RefNannyDeclarations
22604 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22613 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 102, __pyx_L1_error)
22614 __Pyx_GOTREF(__pyx_slice_);
22615 __Pyx_GIVEREF(__pyx_slice_);
22616 __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 102, __pyx_L1_error)
22617 __Pyx_GOTREF(__pyx_slice__2);
22618 __Pyx_GIVEREF(__pyx_slice__2);
22626 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
22627 __Pyx_GOTREF(__pyx_tuple__3);
22628 __Pyx_GIVEREF(__pyx_tuple__3);
22635 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted);
if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
22636 __Pyx_GOTREF(__pyx_tuple__4);
22637 __Pyx_GIVEREF(__pyx_tuple__4);
22646 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 229, __pyx_L1_error)
22647 __Pyx_GOTREF(__pyx_tuple__5);
22648 __Pyx_GIVEREF(__pyx_tuple__5);
22657 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 233, __pyx_L1_error)
22658 __Pyx_GOTREF(__pyx_tuple__6);
22659 __Pyx_GIVEREF(__pyx_tuple__6);
22668 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 263, __pyx_L1_error)
22669 __Pyx_GOTREF(__pyx_tuple__7);
22670 __Pyx_GIVEREF(__pyx_tuple__7);
22679 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 810, __pyx_L1_error)
22680 __Pyx_GOTREF(__pyx_tuple__8);
22681 __Pyx_GIVEREF(__pyx_tuple__8);
22690 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 814, __pyx_L1_error)
22691 __Pyx_GOTREF(__pyx_tuple__9);
22692 __Pyx_GIVEREF(__pyx_tuple__9);
22701 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 834, __pyx_L1_error)
22702 __Pyx_GOTREF(__pyx_tuple__10);
22703 __Pyx_GIVEREF(__pyx_tuple__10);
22712 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to);
if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 1000, __pyx_L1_error)
22713 __Pyx_GOTREF(__pyx_tuple__11);
22714 __Pyx_GIVEREF(__pyx_tuple__11);
22723 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 1006, __pyx_L1_error)
22724 __Pyx_GOTREF(__pyx_tuple__12);
22725 __Pyx_GIVEREF(__pyx_tuple__12);
22732 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor);
if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 1012, __pyx_L1_error)
22733 __Pyx_GOTREF(__pyx_tuple__13);
22734 __Pyx_GIVEREF(__pyx_tuple__13);
22743 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 132, __pyx_L1_error)
22744 __Pyx_GOTREF(__pyx_tuple__14);
22745 __Pyx_GIVEREF(__pyx_tuple__14);
22754 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 135, __pyx_L1_error)
22755 __Pyx_GOTREF(__pyx_tuple__15);
22756 __Pyx_GIVEREF(__pyx_tuple__15);
22765 __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII);
if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 138, __pyx_L1_error)
22766 __Pyx_GOTREF(__pyx_tuple__16);
22767 __Pyx_GIVEREF(__pyx_tuple__16);
22776 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 147, __pyx_L1_error)
22777 __Pyx_GOTREF(__pyx_tuple__17);
22778 __Pyx_GIVEREF(__pyx_tuple__17);
22787 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 175, __pyx_L1_error)
22788 __Pyx_GOTREF(__pyx_tuple__18);
22789 __Pyx_GIVEREF(__pyx_tuple__18);
22798 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 191, __pyx_L1_error)
22799 __Pyx_GOTREF(__pyx_tuple__19);
22800 __Pyx_GIVEREF(__pyx_tuple__19);
22808 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
22809 __Pyx_GOTREF(__pyx_tuple__20);
22810 __Pyx_GIVEREF(__pyx_tuple__20);
22817 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
22818 __Pyx_GOTREF(__pyx_tuple__21);
22819 __Pyx_GIVEREF(__pyx_tuple__21);
22828 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 413, __pyx_L1_error)
22829 __Pyx_GOTREF(__pyx_tuple__22);
22830 __Pyx_GIVEREF(__pyx_tuple__22);
22839 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 490, __pyx_L1_error)
22840 __Pyx_GOTREF(__pyx_tuple__23);
22841 __Pyx_GIVEREF(__pyx_tuple__23);
22850 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 515, __pyx_L1_error)
22851 __Pyx_GOTREF(__pyx_tuple__24);
22852 __Pyx_GIVEREF(__pyx_tuple__24);
22861 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 565, __pyx_L1_error)
22862 __Pyx_GOTREF(__pyx_tuple__25);
22863 __Pyx_GIVEREF(__pyx_tuple__25);
22872 __pyx_tuple__26 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 572, __pyx_L1_error)
22873 __Pyx_GOTREF(__pyx_tuple__26);
22874 __Pyx_INCREF(__pyx_int_neg_1);
22875 __Pyx_GIVEREF(__pyx_int_neg_1);
22876 PyTuple_SET_ITEM(__pyx_tuple__26, 0, __pyx_int_neg_1);
22877 __Pyx_GIVEREF(__pyx_tuple__26);
22885 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
22886 __Pyx_GOTREF(__pyx_tuple__27);
22887 __Pyx_GIVEREF(__pyx_tuple__27);
22894 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
22895 __Pyx_GOTREF(__pyx_tuple__28);
22896 __Pyx_GIVEREF(__pyx_tuple__28);
22905 __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__29)) __PYX_ERR(1, 677, __pyx_L1_error)
22906 __Pyx_GOTREF(__pyx_slice__29);
22907 __Pyx_GIVEREF(__pyx_slice__29);
22916 __pyx_slice__30 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__30)) __PYX_ERR(1, 680, __pyx_L1_error)
22917 __Pyx_GOTREF(__pyx_slice__30);
22918 __Pyx_GIVEREF(__pyx_slice__30);
22927 __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__31)) __PYX_ERR(1, 691, __pyx_L1_error)
22928 __Pyx_GOTREF(__pyx_slice__31);
22929 __Pyx_GIVEREF(__pyx_slice__31);
22938 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 698, __pyx_L1_error)
22939 __Pyx_GOTREF(__pyx_tuple__32);
22940 __Pyx_GIVEREF(__pyx_tuple__32);
22948 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error)
22949 __Pyx_GOTREF(__pyx_tuple__33);
22950 __Pyx_GIVEREF(__pyx_tuple__33);
22957 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error)
22958 __Pyx_GOTREF(__pyx_tuple__34);
22959 __Pyx_GIVEREF(__pyx_tuple__34);
22968 __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 41, __pyx_L1_error)
22969 __Pyx_GOTREF(__pyx_tuple__35);
22970 __Pyx_GIVEREF(__pyx_tuple__35);
22971 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 41, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 41, __pyx_L1_error)
22978 __pyx_tuple__37 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_use_setstate, __pyx_n_s_state, __pyx_n_s_dict_2);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error)
22979 __Pyx_GOTREF(__pyx_tuple__37);
22980 __Pyx_GIVEREF(__pyx_tuple__37);
22981 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error)
22989 __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 14, __pyx_L1_error)
22990 __Pyx_GOTREF(__pyx_tuple__39);
22991 __Pyx_GIVEREF(__pyx_tuple__39);
22992 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 14, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 14, __pyx_L1_error)
23001 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 70, __pyx_L1_error)
23002 __Pyx_GOTREF(__pyx_tuple__41);
23003 __Pyx_GIVEREF(__pyx_tuple__41);
23004 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 70, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 70, __pyx_L1_error)
23013 __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 73, __pyx_L1_error)
23014 __Pyx_GOTREF(__pyx_tuple__43);
23015 __Pyx_GIVEREF(__pyx_tuple__43);
23016 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 73, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 73, __pyx_L1_error)
23025 __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 76, __pyx_L1_error)
23026 __Pyx_GOTREF(__pyx_tuple__45);
23027 __Pyx_GIVEREF(__pyx_tuple__45);
23028 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 76, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 76, __pyx_L1_error)
23037 __pyx_tuple__47 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 89, __pyx_L1_error)
23038 __Pyx_GOTREF(__pyx_tuple__47);
23039 __Pyx_GIVEREF(__pyx_tuple__47);
23040 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 89, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 89, __pyx_L1_error)
23049 __pyx_tuple__49 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_t1, __pyx_n_s_value);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 104, __pyx_L1_error)
23050 __Pyx_GOTREF(__pyx_tuple__49);
23051 __Pyx_GIVEREF(__pyx_tuple__49);
23052 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearRamp, 104, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 104, __pyx_L1_error)
23059 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 1, __pyx_L1_error)
23060 __Pyx_GOTREF(__pyx_tuple__51);
23061 __Pyx_GIVEREF(__pyx_tuple__51);
23062 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(1, 1, __pyx_L1_error)
23070 __pyx_tuple__53 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 3, __pyx_L1_error)
23071 __Pyx_GOTREF(__pyx_tuple__53);
23072 __Pyx_GIVEREF(__pyx_tuple__53);
23073 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(1, 3, __pyx_L1_error)
23080 __pyx_tuple__55 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 1, __pyx_L1_error)
23081 __Pyx_GOTREF(__pyx_tuple__55);
23082 __Pyx_GIVEREF(__pyx_tuple__55);
23083 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(1, 1, __pyx_L1_error)
23092 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 285, __pyx_L1_error)
23093 __Pyx_GOTREF(__pyx_tuple__57);
23094 __Pyx_GIVEREF(__pyx_tuple__57);
23103 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 286, __pyx_L1_error)
23104 __Pyx_GOTREF(__pyx_tuple__58);
23105 __Pyx_GIVEREF(__pyx_tuple__58);
23114 __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 287, __pyx_L1_error)
23115 __Pyx_GOTREF(__pyx_tuple__59);
23116 __Pyx_GIVEREF(__pyx_tuple__59);
23125 __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 290, __pyx_L1_error)
23126 __Pyx_GOTREF(__pyx_tuple__60);
23127 __Pyx_GIVEREF(__pyx_tuple__60);
23136 __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 291, __pyx_L1_error)
23137 __Pyx_GOTREF(__pyx_tuple__61);
23138 __Pyx_GIVEREF(__pyx_tuple__61);
23145 __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 1, __pyx_L1_error)
23146 __Pyx_GOTREF(__pyx_tuple__62);
23147 __Pyx_GIVEREF(__pyx_tuple__62);
23148 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(1, 1, __pyx_L1_error)
23149 __Pyx_RefNannyFinishContext();
23152 __Pyx_RefNannyFinishContext();
23156 static int __Pyx_InitGlobals(
void) {
23157 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23158 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
23159 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23160 __pyx_int_158231071 = PyInt_FromLong(158231071
L);
if (unlikely(!__pyx_int_158231071)) __PYX_ERR(0, 1, __pyx_L1_error)
23161 __pyx_int_184977713 = PyInt_FromLong(184977713
L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
23162 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23168 static int __Pyx_modinit_global_init_code(
void);
23169 static int __Pyx_modinit_variable_export_code(
void);
23170 static int __Pyx_modinit_function_export_code(
void);
23171 static int __Pyx_modinit_type_init_code(
void);
23172 static int __Pyx_modinit_type_import_code(
void);
23173 static int __Pyx_modinit_variable_import_code(
void);
23174 static int __Pyx_modinit_function_import_code(
void);
23176 static int __Pyx_modinit_global_init_code(
void) {
23177 __Pyx_RefNannyDeclarations
23178 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
23180 generic = Py_None; Py_INCREF(Py_None);
23181 strided = Py_None; Py_INCREF(Py_None);
23182 indirect = Py_None; Py_INCREF(Py_None);
23183 contiguous = Py_None; Py_INCREF(Py_None);
23184 indirect_contiguous = Py_None; Py_INCREF(Py_None);
23185 __Pyx_RefNannyFinishContext();
23189 static int __Pyx_modinit_variable_export_code(
void) {
23190 __Pyx_RefNannyDeclarations
23191 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
23193 __Pyx_RefNannyFinishContext();
23197 static int __Pyx_modinit_function_export_code(
void) {
23198 __Pyx_RefNannyDeclarations
23199 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
23201 __Pyx_RefNannyFinishContext();
23205 static int __Pyx_modinit_type_init_code(
void) {
23206 __Pyx_RefNannyDeclarations
23207 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
23209 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23210 __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
23211 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
23212 __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23214 if (PyObject_SetAttrString(__pyx_m,
"BC_Base", (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23215 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
23216 __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
23217 __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
23218 __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(
struct __pyx_obj_18BoundaryConditions_BoundaryCondition *,
int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
23219 if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23220 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
23221 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
23222 __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23224 if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23225 if (PyObject_SetAttrString(__pyx_m,
"BoundaryCondition", (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23226 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
23227 __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
23228 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
23229 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
23230 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
23231 __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23233 __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
23234 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
23235 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
23236 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
23237 __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23239 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
23240 if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
23241 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_print = 0;
23242 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro == PyObject_GenericGetAttr)) {
23243 __pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
23245 __pyx_ptype_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp = &__pyx_type_18BoundaryConditions___pyx_scope_struct_2_setLinearRamp;
23246 __pyx_vtabptr_array = &__pyx_vtable_array;
23247 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
23248 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23249 __pyx_type___pyx_array.tp_print = 0;
23250 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23251 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 104, __pyx_L1_error)
23252 __pyx_array_type = &__pyx_type___pyx_array;
23253 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23254 __pyx_type___pyx_MemviewEnum.tp_print = 0;
23255 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
23256 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23258 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
23259 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
23260 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
23261 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
23262 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
23263 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
23264 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
23265 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
23266 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
23267 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
23268 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23269 __pyx_type___pyx_memoryview.tp_print = 0;
23270 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
23271 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23273 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23274 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
23275 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
23276 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
23277 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
23278 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
23279 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
23280 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
23281 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23282 __pyx_type___pyx_memoryviewslice.tp_print = 0;
23283 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
23284 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
23286 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23287 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 960, __pyx_L1_error)
23288 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
23289 __Pyx_RefNannyFinishContext();
23292 __Pyx_RefNannyFinishContext();
23296 static int __Pyx_modinit_type_import_code(
void) {
23297 __Pyx_RefNannyDeclarations
23298 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
23300 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
23301 #
if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
23302 sizeof(PyTypeObject),
23304 sizeof(PyHeapTypeObject),
23306 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error)
23307 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 164, __pyx_L1_error)
23308 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 186, __pyx_L1_error)
23309 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 190, __pyx_L1_error)
23310 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 199, __pyx_L1_error)
23311 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 872, __pyx_L1_error)
23312 __Pyx_RefNannyFinishContext();
23315 __Pyx_RefNannyFinishContext();
23319 static int __Pyx_modinit_variable_import_code(
void) {
23320 __Pyx_RefNannyDeclarations
23321 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
23323 __Pyx_RefNannyFinishContext();
23327 static int __Pyx_modinit_function_import_code(
void) {
23328 __Pyx_RefNannyDeclarations
23329 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
23331 __Pyx_RefNannyFinishContext();
23336 #if PY_MAJOR_VERSION < 3
23337 #ifdef CYTHON_NO_PYINIT_EXPORT
23338 #define __Pyx_PyMODINIT_FUNC void
23340 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23343 #ifdef CYTHON_NO_PYINIT_EXPORT
23344 #define __Pyx_PyMODINIT_FUNC PyObject *
23346 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
23349 #ifndef CYTHON_SMALL_CODE
23350 #if defined(__clang__)
23351 #define CYTHON_SMALL_CODE
23352 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
23353 #define CYTHON_SMALL_CODE __attribute__((cold))
23355 #define CYTHON_SMALL_CODE
23360 #if PY_MAJOR_VERSION < 3
23361 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void) CYTHON_SMALL_CODE;
23362 __Pyx_PyMODINIT_FUNC initBoundaryConditions(
void)
23364 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void) CYTHON_SMALL_CODE;
23365 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(
void)
23366 #if CYTHON_PEP489_MULTI_PHASE_INIT
23368 return PyModuleDef_Init(&__pyx_moduledef);
23370 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name) {
23371 PyObject *value = PyObject_GetAttrString(spec, from_name);
23373 if (likely(value)) {
23374 result = PyDict_SetItemString(moddict, to_name, value);
23376 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
23383 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
23384 PyObject *module = NULL, *moddict, *modname;
23386 return __Pyx_NewRef(__pyx_m);
23387 modname = PyObject_GetAttrString(spec,
"name");
23388 if (unlikely(!modname))
goto bad;
23389 module = PyModule_NewObject(modname);
23390 Py_DECREF(modname);
23391 if (unlikely(!module))
goto bad;
23392 moddict = PyModule_GetDict(module);
23393 if (unlikely(!moddict))
goto bad;
23394 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__") < 0))
goto bad;
23395 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__") < 0))
goto bad;
23396 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__") < 0))
goto bad;
23397 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__") < 0))
goto bad;
23400 Py_XDECREF(module);
23405 static int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
23409 PyObject *__pyx_t_1 = NULL;
23410 static PyThread_type_lock __pyx_t_2[8];
23411 __Pyx_RefNannyDeclarations
23412 #if CYTHON_PEP489_MULTI_PHASE_INIT
23413 if (__pyx_m && __pyx_m == __pyx_pyinit_module)
return 0;
23414 #elif PY_MAJOR_VERSION >= 3
23415 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
23417 #if CYTHON_REFNANNY
23418 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
23419 if (!__Pyx_RefNanny) {
23421 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
23422 if (!__Pyx_RefNanny)
23423 Py_FatalError(
"failed to import 'refnanny' module");
23426 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
23427 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23428 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
23429 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
23430 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
23431 #ifdef __Pyx_CyFunction_USED
23432 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23434 #ifdef __Pyx_FusedFunction_USED
23435 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23437 #ifdef __Pyx_Coroutine_USED
23438 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23440 #ifdef __Pyx_Generator_USED
23441 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23443 #ifdef __Pyx_AsyncGen_USED
23444 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23446 #ifdef __Pyx_StopAsyncIteration_USED
23447 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23451 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23453 PyEval_InitThreads();
23457 #if CYTHON_PEP489_MULTI_PHASE_INIT
23458 __pyx_m = __pyx_pyinit_module;
23459 Py_INCREF(__pyx_m);
23461 #if PY_MAJOR_VERSION < 3
23462 __pyx_m = Py_InitModule4(
"BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23464 __pyx_m = PyModule_Create(&__pyx_moduledef);
23466 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
23468 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
23469 Py_INCREF(__pyx_d);
23470 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
23471 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
23472 #if CYTHON_COMPILING_IN_PYPY
23473 Py_INCREF(__pyx_b);
23475 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
23477 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23478 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23479 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23481 if (__pyx_module_is_main_BoundaryConditions) {
23482 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23484 #if PY_MAJOR_VERSION >= 3
23486 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
23487 if (!PyDict_GetItemString(modules,
"BoundaryConditions")) {
23488 if (unlikely(PyDict_SetItemString(modules,
"BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
23493 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23495 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23497 (void)__Pyx_modinit_global_init_code();
23498 (void)__Pyx_modinit_variable_export_code();
23499 (void)__Pyx_modinit_function_export_code();
23500 if (unlikely(__Pyx_modinit_type_init_code() != 0))
goto __pyx_L1_error;
23501 if (unlikely(__Pyx_modinit_type_import_code() != 0))
goto __pyx_L1_error;
23502 (void)__Pyx_modinit_variable_import_code();
23503 (void)__Pyx_modinit_function_import_code();
23505 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23506 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23516 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__36));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
23517 __Pyx_GOTREF(__pyx_t_1);
23518 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
23519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23520 PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23527 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__38));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23528 __Pyx_GOTREF(__pyx_t_1);
23529 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23530 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23538 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__40));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
23539 __Pyx_GOTREF(__pyx_t_1);
23540 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 14, __pyx_L1_error)
23541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23550 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__42));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
23551 __Pyx_GOTREF(__pyx_t_1);
23552 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
23553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23554 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23563 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__44));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
23564 __Pyx_GOTREF(__pyx_t_1);
23565 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
23566 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23567 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23576 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__46));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
23577 __Pyx_GOTREF(__pyx_t_1);
23578 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
23579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23580 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23589 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__48));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
23590 __Pyx_GOTREF(__pyx_t_1);
23591 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
23592 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23593 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23602 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearRamp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearRamp, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__50));
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
23603 __Pyx_GOTREF(__pyx_t_1);
23604 if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearRamp, __pyx_t_1) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
23605 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23606 PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23613 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__52));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23614 __Pyx_GOTREF(__pyx_t_1);
23615 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23616 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23624 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__54));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
23625 __Pyx_GOTREF(__pyx_t_1);
23626 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
23627 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23634 __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__56));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23635 __Pyx_GOTREF(__pyx_t_1);
23636 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23637 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23644 __pyx_t_1 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23645 __Pyx_GOTREF(__pyx_t_1);
23646 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23647 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23656 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 208, __pyx_L1_error)
23657 __Pyx_GOTREF(__pyx_t_1);
23658 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 208, __pyx_L1_error)
23659 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23660 PyType_Modified(__pyx_array_type);
23669 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 285, __pyx_L1_error)
23670 __Pyx_GOTREF(__pyx_t_1);
23671 __Pyx_XGOTREF(
generic);
23672 __Pyx_DECREF_SET(
generic, __pyx_t_1);
23673 __Pyx_GIVEREF(__pyx_t_1);
23683 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 286, __pyx_L1_error)
23684 __Pyx_GOTREF(__pyx_t_1);
23685 __Pyx_XGOTREF(strided);
23686 __Pyx_DECREF_SET(strided, __pyx_t_1);
23687 __Pyx_GIVEREF(__pyx_t_1);
23697 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __pyx_L1_error)
23698 __Pyx_GOTREF(__pyx_t_1);
23699 __Pyx_XGOTREF(indirect);
23700 __Pyx_DECREF_SET(indirect, __pyx_t_1);
23701 __Pyx_GIVEREF(__pyx_t_1);
23711 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 290, __pyx_L1_error)
23712 __Pyx_GOTREF(__pyx_t_1);
23713 __Pyx_XGOTREF(contiguous);
23714 __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23715 __Pyx_GIVEREF(__pyx_t_1);
23725 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 291, __pyx_L1_error)
23726 __Pyx_GOTREF(__pyx_t_1);
23727 __Pyx_XGOTREF(indirect_contiguous);
23728 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23729 __Pyx_GIVEREF(__pyx_t_1);
23739 __pyx_memoryview_thread_locks_used = 0;
23748 __pyx_t_2[0] = PyThread_allocate_lock();
23749 __pyx_t_2[1] = PyThread_allocate_lock();
23750 __pyx_t_2[2] = PyThread_allocate_lock();
23751 __pyx_t_2[3] = PyThread_allocate_lock();
23752 __pyx_t_2[4] = PyThread_allocate_lock();
23753 __pyx_t_2[5] = PyThread_allocate_lock();
23754 __pyx_t_2[6] = PyThread_allocate_lock();
23755 __pyx_t_2[7] = PyThread_allocate_lock();
23756 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23765 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 544, __pyx_L1_error)
23766 __Pyx_GOTREF(__pyx_t_1);
23767 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 544, __pyx_L1_error)
23768 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23769 PyType_Modified(__pyx_memoryview_type);
23778 __pyx_t_1 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
23779 __Pyx_GOTREF(__pyx_t_1);
23780 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 990, __pyx_L1_error)
23781 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23782 PyType_Modified(__pyx_memoryviewslice_type);
23789 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23790 __Pyx_GOTREF(__pyx_t_1);
23791 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23792 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23806 __Pyx_XDECREF(__pyx_t_1);
23809 __Pyx_AddTraceback(
"init BoundaryConditions", 0, __pyx_lineno, __pyx_filename);
23811 Py_DECREF(__pyx_m); __pyx_m = 0;
23812 }
else if (!PyErr_Occurred()) {
23813 PyErr_SetString(PyExc_ImportError,
"init BoundaryConditions");
23816 __Pyx_RefNannyFinishContext();
23817 #if CYTHON_PEP489_MULTI_PHASE_INIT
23818 return (__pyx_m != NULL) ? 0 : -1;
23819 #elif PY_MAJOR_VERSION >= 3
23828 #if CYTHON_REFNANNY
23829 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23830 PyObject *m = NULL, *p = NULL;
23832 m = PyImport_ImportModule((
char *)modname);
23834 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
23836 r = PyLong_AsVoidPtr(p);
23840 return (__Pyx_RefNannyAPIStruct *)
r;
23845 #if CYTHON_USE_TYPE_SLOTS
23846 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23847 PyTypeObject* tp = Py_TYPE(obj);
23848 if (likely(tp->tp_getattro))
23849 return tp->tp_getattro(obj, attr_name);
23850 #if PY_MAJOR_VERSION < 3
23851 if (likely(tp->tp_getattr))
23852 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23854 return PyObject_GetAttr(obj, attr_name);
23859 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23860 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23861 if (unlikely(!result)) {
23862 PyErr_Format(PyExc_NameError,
23863 #
if PY_MAJOR_VERSION >= 3
23864 "name '%U' is not defined", name);
23866 "name '%.200s' is not defined", PyString_AS_STRING(name));
23873 static void __Pyx_RaiseDoubleKeywordsError(
23874 const char* func_name,
23877 PyErr_Format(PyExc_TypeError,
23878 #
if PY_MAJOR_VERSION >= 3
23879 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23881 "%s() got multiple values for keyword argument '%s'", func_name,
23882 PyString_AsString(kw_name));
23887 static int __Pyx_ParseOptionalKeywords(
23889 PyObject **argnames[],
23891 PyObject *values[],
23892 Py_ssize_t num_pos_args,
23893 const char* function_name)
23895 PyObject *key = 0, *value = 0;
23896 Py_ssize_t
pos = 0;
23898 PyObject*** first_kw_arg = argnames + num_pos_args;
23899 while (PyDict_Next(kwds, &
pos, &key, &value)) {
23900 name = first_kw_arg;
23901 while (*name && (**name != key)) name++;
23903 values[name-argnames] = value;
23906 name = first_kw_arg;
23907 #if PY_MAJOR_VERSION < 3
23908 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23910 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23911 && _PyString_Eq(**name, key)) {
23912 values[name-argnames] = value;
23917 if (*name)
continue;
23919 PyObject*** argname = argnames;
23920 while (argname != first_kw_arg) {
23921 if ((**argname == key) || (
23922 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23923 && _PyString_Eq(**argname, key))) {
23924 goto arg_passed_twice;
23931 if (likely(PyUnicode_Check(key))) {
23933 int cmp = (**name == key) ? 0 :
23934 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23935 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23937 PyUnicode_Compare(**name, key);
23938 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23940 values[name-argnames] = value;
23945 if (*name)
continue;
23947 PyObject*** argname = argnames;
23948 while (argname != first_kw_arg) {
23949 int cmp = (**argname == key) ? 0 :
23950 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23951 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23953 PyUnicode_Compare(**argname, key);
23954 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23955 if (cmp == 0)
goto arg_passed_twice;
23960 goto invalid_keyword_type;
23962 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23964 goto invalid_keyword;
23969 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23971 invalid_keyword_type:
23972 PyErr_Format(PyExc_TypeError,
23973 "%.200s() keywords must be strings", function_name);
23976 PyErr_Format(PyExc_TypeError,
23977 #
if PY_MAJOR_VERSION < 3
23978 "%.200s() got an unexpected keyword argument '%.200s'",
23979 function_name, PyString_AsString(key));
23981 "%s() got an unexpected keyword argument '%U'",
23982 function_name, key);
23989 static void __Pyx_RaiseArgtupleInvalid(
23990 const char* func_name,
23992 Py_ssize_t num_min,
23993 Py_ssize_t num_max,
23994 Py_ssize_t num_found)
23996 Py_ssize_t num_expected;
23997 const char *more_or_less;
23998 if (num_found < num_min) {
23999 num_expected = num_min;
24000 more_or_less =
"at least";
24002 num_expected = num_max;
24003 more_or_less =
"at most";
24006 more_or_less =
"exactly";
24008 PyErr_Format(PyExc_TypeError,
24009 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
24010 func_name, more_or_less, num_expected,
24011 (num_expected == 1) ?
"" :
"s", num_found);
24015 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24017 if (!j)
return NULL;
24018 r = PyObject_GetItem(o, j);
24022 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24023 CYTHON_NCP_UNUSED
int wraparound,
24024 CYTHON_NCP_UNUSED
int boundscheck) {
24025 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24026 Py_ssize_t wrapped_i = i;
24027 if (wraparound & unlikely(i < 0)) {
24028 wrapped_i += PyList_GET_SIZE(o);
24030 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
24031 PyObject *
r = PyList_GET_ITEM(o, wrapped_i);
24035 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24037 return PySequence_GetItem(o, i);
24040 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24041 CYTHON_NCP_UNUSED
int wraparound,
24042 CYTHON_NCP_UNUSED
int boundscheck) {
24043 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24044 Py_ssize_t wrapped_i = i;
24045 if (wraparound & unlikely(i < 0)) {
24046 wrapped_i += PyTuple_GET_SIZE(o);
24048 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
24049 PyObject *
r = PyTuple_GET_ITEM(o, wrapped_i);
24053 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24055 return PySequence_GetItem(o, i);
24058 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24059 CYTHON_NCP_UNUSED
int wraparound,
24060 CYTHON_NCP_UNUSED
int boundscheck) {
24061 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24062 if (is_list || PyList_CheckExact(o)) {
24063 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24064 if ((!boundscheck) || (likely((
n >= 0) & (
n < PyList_GET_SIZE(o))))) {
24065 PyObject *
r = PyList_GET_ITEM(o,
n);
24070 else if (PyTuple_CheckExact(o)) {
24071 Py_ssize_t
n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24072 if ((!boundscheck) || likely((
n >= 0) & (
n < PyTuple_GET_SIZE(o)))) {
24073 PyObject *
r = PyTuple_GET_ITEM(o,
n);
24078 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24079 if (likely(m && m->sq_item)) {
24080 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24081 Py_ssize_t l = m->sq_length(o);
24082 if (likely(l >= 0)) {
24085 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24090 return m->sq_item(o, i);
24094 if (is_list || PySequence_Check(o)) {
24095 return PySequence_GetItem(o, i);
24098 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24102 #if CYTHON_USE_TYPE_SLOTS
24103 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24105 Py_ssize_t key_value;
24106 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24107 if (unlikely(!(m && m->sq_item))) {
24108 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24111 key_value = __Pyx_PyIndex_AsSsize_t(index);
24112 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24113 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24115 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24117 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24121 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24122 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24123 if (likely(m && m->mp_subscript)) {
24124 return m->mp_subscript(obj, key);
24126 return __Pyx_PyObject_GetIndex(obj, key);
24132 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24134 __Pyx_memviewslice *memviewslice,
24135 int memview_is_new_reference)
24137 __Pyx_RefNannyDeclarations
24139 Py_buffer *buf = &memview->view;
24140 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24142 PyErr_SetString(PyExc_ValueError,
24145 }
else if (memviewslice->memview || memviewslice->data) {
24146 PyErr_SetString(PyExc_ValueError,
24147 "memviewslice is already initialized!");
24150 if (buf->strides) {
24151 for (i = 0; i < ndim; i++) {
24152 memviewslice->strides[i] = buf->strides[i];
24155 Py_ssize_t stride = buf->itemsize;
24156 for (i = ndim - 1; i >= 0; i--) {
24157 memviewslice->strides[i] = stride;
24158 stride *= buf->shape[i];
24161 for (i = 0; i < ndim; i++) {
24162 memviewslice->shape[i] = buf->shape[i];
24163 if (buf->suboffsets) {
24164 memviewslice->suboffsets[i] = buf->suboffsets[i];
24166 memviewslice->suboffsets[i] = -1;
24169 memviewslice->memview = memview;
24170 memviewslice->data = (
char *)buf->buf;
24171 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24172 Py_INCREF(memview);
24177 memviewslice->memview = 0;
24178 memviewslice->data = 0;
24181 __Pyx_RefNannyFinishContext();
24184 #ifndef Py_NO_RETURN
24185 #define Py_NO_RETURN
24187 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24190 #ifdef HAVE_STDARG_PROTOTYPES
24191 va_start(vargs, fmt);
24195 vsnprintf(msg, 200, fmt, vargs);
24197 Py_FatalError(msg);
24199 static CYTHON_INLINE
int
24200 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24201 PyThread_type_lock lock)
24204 PyThread_acquire_lock(lock, 1);
24205 result = (*acquisition_count)++;
24206 PyThread_release_lock(lock);
24209 static CYTHON_INLINE
int
24210 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24211 PyThread_type_lock lock)
24214 PyThread_acquire_lock(lock, 1);
24215 result = (*acquisition_count)--;
24216 PyThread_release_lock(lock);
24219 static CYTHON_INLINE
void
24220 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24223 struct __pyx_memoryview_obj *memview = memslice->memview;
24224 if (!memview || (PyObject *) memview == Py_None)
24226 if (__pyx_get_slice_count(memview) < 0)
24227 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24228 __pyx_get_slice_count(memview), lineno);
24229 first_time = __pyx_add_acquisition_count(memview) == 0;
24232 Py_INCREF((PyObject *) memview);
24234 PyGILState_STATE _gilstate = PyGILState_Ensure();
24235 Py_INCREF((PyObject *) memview);
24236 PyGILState_Release(_gilstate);
24240 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24241 int have_gil,
int lineno) {
24243 struct __pyx_memoryview_obj *memview = memslice->memview;
24246 }
else if ((PyObject *) memview == Py_None) {
24247 memslice->memview = NULL;
24250 if (__pyx_get_slice_count(memview) <= 0)
24251 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24252 __pyx_get_slice_count(memview), lineno);
24253 last_time = __pyx_sub_acquisition_count(memview) == 1;
24254 memslice->data = NULL;
24257 Py_CLEAR(memslice->memview);
24259 PyGILState_STATE _gilstate = PyGILState_Ensure();
24260 Py_CLEAR(memslice->memview);
24261 PyGILState_Release(_gilstate);
24264 memslice->memview = NULL;
24269 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24270 PyObject *empty_list = 0;
24271 PyObject *module = 0;
24272 PyObject *global_dict = 0;
24273 PyObject *empty_dict = 0;
24275 #if PY_MAJOR_VERSION < 3
24276 PyObject *py_import;
24277 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24284 empty_list = PyList_New(0);
24289 global_dict = PyModule_GetDict(__pyx_m);
24292 empty_dict = PyDict_New();
24296 #if PY_MAJOR_VERSION >= 3
24298 if (strchr(__Pyx_MODULE_NAME,
'.')) {
24299 module = PyImport_ImportModuleLevelObject(
24300 name, global_dict, empty_dict, list, 1);
24302 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24311 #if PY_MAJOR_VERSION < 3
24312 PyObject *py_level = PyInt_FromLong(level);
24315 module = PyObject_CallFunctionObjArgs(py_import,
24316 name, global_dict, empty_dict, list, py_level, NULL);
24317 Py_DECREF(py_level);
24319 module = PyImport_ImportModuleLevelObject(
24320 name, global_dict, empty_dict, list, level);
24325 #if PY_MAJOR_VERSION < 3
24326 Py_XDECREF(py_import);
24328 Py_XDECREF(empty_list);
24329 Py_XDECREF(empty_dict);
24334 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
24335 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
24336 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
24337 PyErr_Format(PyExc_ImportError,
24338 #
if PY_MAJOR_VERSION < 3
24339 "cannot import name %.230s", PyString_AS_STRING(name));
24341 "cannot import name %S", name);
24348 #if CYTHON_FAST_PYCCALL
24349 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24350 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24351 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24352 PyObject *
self = PyCFunction_GET_SELF(func);
24353 int flags = PyCFunction_GET_FLAGS(func);
24354 assert(PyCFunction_Check(func));
24355 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
24356 assert(nargs >= 0);
24357 assert(nargs == 0 || args != NULL);
24361 assert(!PyErr_Occurred());
24362 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24363 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (
self, args, nargs, NULL);
24365 return (*((__Pyx_PyCFunctionFast)meth)) (
self, args, nargs);
24371 #if CYTHON_FAST_PYCALL
24372 #include "frameobject.h"
24373 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24374 PyObject *globals) {
24376 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24377 PyObject **fastlocals;
24380 assert(globals != NULL);
24385 assert(tstate != NULL);
24386 f = PyFrame_New(tstate, co, globals, NULL);
24390 fastlocals =
f->f_localsplus;
24391 for (i = 0; i < na; i++) {
24393 fastlocals[i] = *args++;
24395 result = PyEval_EvalFrameEx(
f,0);
24396 ++tstate->recursion_depth;
24398 --tstate->recursion_depth;
24401 #if 1 || PY_VERSION_HEX < 0x030600B1
24402 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
int nargs, PyObject *kwargs) {
24403 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24404 PyObject *globals = PyFunction_GET_GLOBALS(func);
24405 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24407 #if PY_MAJOR_VERSION >= 3
24410 PyObject *kwtuple, **k;
24415 assert(kwargs == NULL || PyDict_Check(kwargs));
24416 nk = kwargs ? PyDict_Size(kwargs) : 0;
24417 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24421 #
if PY_MAJOR_VERSION >= 3
24422 co->co_kwonlyargcount == 0 &&
24424 likely(kwargs == NULL || nk == 0) &&
24425 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24426 if (argdefs == NULL && co->co_argcount == nargs) {
24427 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24430 else if (nargs == 0 && argdefs != NULL
24431 && co->co_argcount == Py_SIZE(argdefs)) {
24434 args = &PyTuple_GET_ITEM(argdefs, 0);
24435 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24439 if (kwargs != NULL) {
24441 kwtuple = PyTuple_New(2 * nk);
24442 if (kwtuple == NULL) {
24446 k = &PyTuple_GET_ITEM(kwtuple, 0);
24448 while (PyDict_Next(kwargs, &
pos, &k[i], &k[i+1])) {
24459 closure = PyFunction_GET_CLOSURE(func);
24460 #if PY_MAJOR_VERSION >= 3
24461 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24463 if (argdefs != NULL) {
24464 d = &PyTuple_GET_ITEM(argdefs, 0);
24465 nd = Py_SIZE(argdefs);
24471 #if PY_MAJOR_VERSION >= 3
24472 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24475 d, (
int)nd, kwdefs, closure);
24477 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24480 d, (
int)nd, closure);
24482 Py_XDECREF(kwtuple);
24484 Py_LeaveRecursiveCall();
24491 #if CYTHON_COMPILING_IN_CPYTHON
24492 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24494 ternaryfunc call = func->ob_type->tp_call;
24495 if (unlikely(!call))
24496 return PyObject_Call(func, arg, kw);
24497 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24499 result = (*call)(func, arg, kw);
24500 Py_LeaveRecursiveCall();
24501 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24504 "NULL result without error in PyObject_Call");
24511 #if CYTHON_COMPILING_IN_CPYTHON
24512 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24513 PyObject *
self, *result;
24515 cfunc = PyCFunction_GET_FUNCTION(func);
24516 self = PyCFunction_GET_SELF(func);
24517 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24519 result = cfunc(
self, arg);
24520 Py_LeaveRecursiveCall();
24521 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24524 "NULL result without error in PyObject_Call");
24531 #if CYTHON_COMPILING_IN_CPYTHON
24532 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24534 PyObject *args = PyTuple_New(1);
24535 if (unlikely(!args))
return NULL;
24537 PyTuple_SET_ITEM(args, 0, arg);
24538 result = __Pyx_PyObject_Call(func, args, NULL);
24542 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24543 #if CYTHON_FAST_PYCALL
24544 if (PyFunction_Check(func)) {
24545 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24548 if (likely(PyCFunction_Check(func))) {
24549 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24550 return __Pyx_PyObject_CallMethO(func, arg);
24551 #if CYTHON_FAST_PYCCALL
24552 }
else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24553 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24557 return __Pyx__PyObject_CallOneArg(func, arg);
24560 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24562 PyObject *args = PyTuple_Pack(1, arg);
24563 if (unlikely(!args))
return NULL;
24564 result = __Pyx_PyObject_Call(func, args, NULL);
24571 #if CYTHON_COMPILING_IN_CPYTHON
24572 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24573 #if CYTHON_FAST_PYCALL
24574 if (PyFunction_Check(func)) {
24575 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24578 #ifdef __Pyx_CyFunction_USED
24579 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24581 if (likely(PyCFunction_Check(func))) {
24583 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24584 return __Pyx_PyObject_CallMethO(func, NULL);
24587 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24592 #if CYTHON_FAST_THREAD_STATE
24593 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24595 n = PyTuple_GET_SIZE(tuple);
24596 #if PY_MAJOR_VERSION >= 3
24597 for (i=0; i<
n; i++) {
24598 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24601 for (i=0; i<
n; i++) {
24602 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24606 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24607 PyObject *exc_type = tstate->curexc_type;
24608 if (exc_type == err)
return 1;
24609 if (unlikely(!exc_type))
return 0;
24610 if (unlikely(PyTuple_Check(err)))
24611 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24612 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24617 #if CYTHON_FAST_THREAD_STATE
24618 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24619 PyObject *tmp_type, *tmp_value, *tmp_tb;
24620 tmp_type = tstate->curexc_type;
24621 tmp_value = tstate->curexc_value;
24622 tmp_tb = tstate->curexc_traceback;
24623 tstate->curexc_type = type;
24624 tstate->curexc_value = value;
24625 tstate->curexc_traceback = tb;
24626 Py_XDECREF(tmp_type);
24627 Py_XDECREF(tmp_value);
24628 Py_XDECREF(tmp_tb);
24630 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24631 *type = tstate->curexc_type;
24632 *value = tstate->curexc_value;
24633 *tb = tstate->curexc_traceback;
24634 tstate->curexc_type = 0;
24635 tstate->curexc_value = 0;
24636 tstate->curexc_traceback = 0;
24641 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *
n) {
24642 #if CYTHON_USE_TYPE_SLOTS
24643 #if PY_MAJOR_VERSION >= 3
24644 if (likely(PyUnicode_Check(
n)))
24646 if (likely(PyString_Check(
n)))
24648 return __Pyx_PyObject_GetAttrStr(o,
n);
24650 return PyObject_GetAttr(o,
n);
24654 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24655 __Pyx_PyThreadState_declare
24656 __Pyx_PyThreadState_assign
24657 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24659 __Pyx_PyErr_Clear();
24663 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *
n, PyObject *d) {
24664 PyObject *
r = __Pyx_GetAttr(o,
n);
24665 return (likely(
r)) ?
r : __Pyx_GetAttr3Default(d);
24669 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
24671 #if !CYTHON_AVOID_BORROWED_REFS
24672 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24673 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24674 if (likely(result)) {
24676 }
else if (unlikely(PyErr_Occurred())) {
24680 result = PyDict_GetItem(__pyx_d, name);
24681 if (likely(result)) {
24686 result = PyObject_GetItem(__pyx_d, name);
24690 result = __Pyx_GetBuiltinName(name);
24696 static int __Pyx_CheckKeywordStrings(
24698 const char* function_name,
24702 Py_ssize_t
pos = 0;
24703 #if CYTHON_COMPILING_IN_PYPY
24704 if (!kw_allowed && PyDict_Next(kwdict, &
pos, &key, 0))
24705 goto invalid_keyword;
24708 while (PyDict_Next(kwdict, &
pos, &key, 0)) {
24709 #if PY_MAJOR_VERSION < 3
24710 if (unlikely(!PyString_Check(key)))
24712 if (unlikely(!PyUnicode_Check(key)))
24713 goto invalid_keyword_type;
24715 if ((!kw_allowed) && unlikely(key))
24716 goto invalid_keyword;
24718 invalid_keyword_type:
24719 PyErr_Format(PyExc_TypeError,
24720 "%.200s() keywords must be strings", function_name);
24724 PyErr_Format(PyExc_TypeError,
24725 #
if PY_MAJOR_VERSION < 3
24726 "%.200s() got an unexpected keyword argument '%.200s'",
24727 function_name, PyString_AsString(key));
24729 "%s() got an unexpected keyword argument '%U'",
24730 function_name, key);
24736 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24737 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24738 int full_traceback, CYTHON_UNUSED
int nogil) {
24739 PyObject *old_exc, *old_val, *old_tb;
24741 __Pyx_PyThreadState_declare
24743 PyGILState_STATE state;
24745 state = PyGILState_Ensure();
24747 else state = (PyGILState_STATE)-1;
24750 __Pyx_PyThreadState_assign
24751 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24752 if (full_traceback) {
24753 Py_XINCREF(old_exc);
24754 Py_XINCREF(old_val);
24755 Py_XINCREF(old_tb);
24756 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24759 #if PY_MAJOR_VERSION < 3
24760 ctx = PyString_FromString(name);
24762 ctx = PyUnicode_FromString(name);
24764 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24766 PyErr_WriteUnraisable(Py_None);
24768 PyErr_WriteUnraisable(ctx);
24773 PyGILState_Release(state);
24778 static CYTHON_INLINE
void __Pyx_RaiseClosureNameError(
const char *varname) {
24779 PyErr_Format(PyExc_NameError,
"free variable '%s' referenced before assignment in enclosing scope", varname);
24783 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24784 PyObject* fake_module;
24785 PyTypeObject* cached_type = NULL;
24786 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
24787 if (!fake_module)
return NULL;
24788 Py_INCREF(fake_module);
24789 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24791 if (!PyType_Check((PyObject*)cached_type)) {
24792 PyErr_Format(PyExc_TypeError,
24793 "Shared Cython type %.200s is not a type object",
24797 if (cached_type->tp_basicsize != type->tp_basicsize) {
24798 PyErr_Format(PyExc_TypeError,
24799 "Shared Cython type %.200s has the wrong size, try recompiling",
24804 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
24806 if (PyType_Ready(type) < 0)
goto bad;
24807 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24810 cached_type = type;
24813 Py_DECREF(fake_module);
24814 return cached_type;
24816 Py_XDECREF(cached_type);
24817 cached_type = NULL;
24822 #include <structmember.h>
24824 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
24826 if (unlikely(op->func_doc == NULL)) {
24827 if (op->func.m_ml->ml_doc) {
24828 #if PY_MAJOR_VERSION >= 3
24829 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24831 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24833 if (unlikely(op->func_doc == NULL))
24836 Py_INCREF(Py_None);
24840 Py_INCREF(op->func_doc);
24841 return op->func_doc;
24844 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
24846 PyObject *tmp = op->func_doc;
24847 if (value == NULL) {
24851 op->func_doc = value;
24856 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
24858 if (unlikely(op->func_name == NULL)) {
24859 #if PY_MAJOR_VERSION >= 3
24860 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24862 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24864 if (unlikely(op->func_name == NULL))
24867 Py_INCREF(op->func_name);
24868 return op->func_name;
24871 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
24874 #if PY_MAJOR_VERSION >= 3
24875 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24877 if (unlikely(value == NULL || !PyString_Check(value))) {
24879 PyErr_SetString(PyExc_TypeError,
24880 "__name__ must be set to a string object");
24883 tmp = op->func_name;
24885 op->func_name = value;
24890 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
24892 Py_INCREF(op->func_qualname);
24893 return op->func_qualname;
24896 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
24899 #if PY_MAJOR_VERSION >= 3
24900 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24902 if (unlikely(value == NULL || !PyString_Check(value))) {
24904 PyErr_SetString(PyExc_TypeError,
24905 "__qualname__ must be set to a string object");
24908 tmp = op->func_qualname;
24910 op->func_qualname = value;
24915 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
24918 self = m->func_closure;
24925 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
24927 if (unlikely(op->func_dict == NULL)) {
24928 op->func_dict = PyDict_New();
24929 if (unlikely(op->func_dict == NULL))
24932 Py_INCREF(op->func_dict);
24933 return op->func_dict;
24936 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
24939 if (unlikely(value == NULL)) {
24940 PyErr_SetString(PyExc_TypeError,
24941 "function's dictionary may not be deleted");
24944 if (unlikely(!PyDict_Check(value))) {
24945 PyErr_SetString(PyExc_TypeError,
24946 "setting function's dictionary to a non-dict");
24949 tmp = op->func_dict;
24951 op->func_dict = value;
24956 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
24958 Py_INCREF(op->func_globals);
24959 return op->func_globals;
24962 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
24964 Py_INCREF(Py_None);
24968 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
24970 PyObject* result = (op->func_code) ? op->func_code : Py_None;
24975 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24977 PyObject *res = op->defaults_getter((PyObject *) op);
24978 if (unlikely(!res))
24980 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24981 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24982 Py_INCREF(op->defaults_tuple);
24983 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24984 Py_INCREF(op->defaults_kwdict);
24986 op->defaults_tuple = PySequence_ITEM(res, 0);
24987 if (unlikely(!op->defaults_tuple)) result = -1;
24989 op->defaults_kwdict = PySequence_ITEM(res, 1);
24990 if (unlikely(!op->defaults_kwdict)) result = -1;
24997 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
25001 }
else if (value != Py_None && !PyTuple_Check(value)) {
25002 PyErr_SetString(PyExc_TypeError,
25003 "__defaults__ must be set to a tuple object");
25007 tmp = op->defaults_tuple;
25008 op->defaults_tuple = value;
25013 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
25014 PyObject* result = op->defaults_tuple;
25015 if (unlikely(!result)) {
25016 if (op->defaults_getter) {
25017 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25018 result = op->defaults_tuple;
25027 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
25031 }
else if (value != Py_None && !PyDict_Check(value)) {
25032 PyErr_SetString(PyExc_TypeError,
25033 "__kwdefaults__ must be set to a dict object");
25037 tmp = op->defaults_kwdict;
25038 op->defaults_kwdict = value;
25043 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
25044 PyObject* result = op->defaults_kwdict;
25045 if (unlikely(!result)) {
25046 if (op->defaults_getter) {
25047 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
25048 result = op->defaults_kwdict;
25057 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
25059 if (!value || value == Py_None) {
25061 }
else if (!PyDict_Check(value)) {
25062 PyErr_SetString(PyExc_TypeError,
25063 "__annotations__ must be set to a dict object");
25067 tmp = op->func_annotations;
25068 op->func_annotations = value;
25073 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
25074 PyObject* result = op->func_annotations;
25075 if (unlikely(!result)) {
25076 result = PyDict_New();
25077 if (unlikely(!result))
return NULL;
25078 op->func_annotations = result;
25083 static PyGetSetDef __pyx_CyFunction_getsets[] = {
25084 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25085 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
25086 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25087 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
25088 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
25089 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
25090 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25091 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
25092 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25093 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
25094 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25095 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
25096 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25097 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
25098 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25099 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
25100 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
25101 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
25104 static PyMemberDef __pyx_CyFunction_members[] = {
25105 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
25109 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
25111 #if PY_MAJOR_VERSION >= 3
25112 return PyUnicode_FromString(m->func.m_ml->ml_name);
25114 return PyString_FromString(m->func.m_ml->ml_name);
25117 static PyMethodDef __pyx_CyFunction_methods[] = {
25118 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
25121 #if PY_VERSION_HEX < 0x030500A0
25122 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
25124 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
25126 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml,
int flags, PyObject* qualname,
25127 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
25128 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
25132 __Pyx_CyFunction_weakreflist(op) = NULL;
25133 op->func.m_ml = ml;
25134 op->func.m_self = (PyObject *) op;
25135 Py_XINCREF(closure);
25136 op->func_closure = closure;
25137 Py_XINCREF(module);
25138 op->func.m_module = module;
25139 op->func_dict = NULL;
25140 op->func_name = NULL;
25141 Py_INCREF(qualname);
25142 op->func_qualname = qualname;
25143 op->func_doc = NULL;
25144 op->func_classobj = NULL;
25145 op->func_globals = globals;
25146 Py_INCREF(op->func_globals);
25148 op->func_code = code;
25149 op->defaults_pyobjects = 0;
25150 op->defaults = NULL;
25151 op->defaults_tuple = NULL;
25152 op->defaults_kwdict = NULL;
25153 op->defaults_getter = NULL;
25154 op->func_annotations = NULL;
25155 PyObject_GC_Track(op);
25156 return (PyObject *) op;
25159 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
25161 Py_CLEAR(m->func_closure);
25162 Py_CLEAR(m->func.m_module);
25163 Py_CLEAR(m->func_dict);
25164 Py_CLEAR(m->func_name);
25165 Py_CLEAR(m->func_qualname);
25166 Py_CLEAR(m->func_doc);
25167 Py_CLEAR(m->func_globals);
25168 Py_CLEAR(m->func_code);
25169 Py_CLEAR(m->func_classobj);
25170 Py_CLEAR(m->defaults_tuple);
25171 Py_CLEAR(m->defaults_kwdict);
25172 Py_CLEAR(m->func_annotations);
25174 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25176 for (i = 0; i < m->defaults_pyobjects; i++)
25177 Py_XDECREF(pydefaults[i]);
25178 PyObject_Free(m->defaults);
25179 m->defaults = NULL;
25183 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25185 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25186 PyObject_ClearWeakRefs((PyObject *) m);
25187 __Pyx_CyFunction_clear(m);
25188 PyObject_GC_Del(m);
25190 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
25192 PyObject_GC_UnTrack(m);
25193 __Pyx__CyFunction_dealloc(m);
25195 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
25197 Py_VISIT(m->func_closure);
25198 Py_VISIT(m->func.m_module);
25199 Py_VISIT(m->func_dict);
25200 Py_VISIT(m->func_name);
25201 Py_VISIT(m->func_qualname);
25202 Py_VISIT(m->func_doc);
25203 Py_VISIT(m->func_globals);
25204 Py_VISIT(m->func_code);
25205 Py_VISIT(m->func_classobj);
25206 Py_VISIT(m->defaults_tuple);
25207 Py_VISIT(m->defaults_kwdict);
25209 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
25211 for (i = 0; i < m->defaults_pyobjects; i++)
25212 Py_VISIT(pydefaults[i]);
25216 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
25218 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25219 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
25223 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
25225 type = (PyObject *)(Py_TYPE(obj));
25226 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
25228 if (obj == Py_None)
25230 return __Pyx_PyMethod_New(func, obj, type);
25233 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
25235 #if PY_MAJOR_VERSION >= 3
25236 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
25237 op->func_qualname, (
void *)op);
25239 return PyString_FromFormat(
"<cyfunction %s at %p>",
25240 PyString_AsString(op->func_qualname), (
void *)op);
25243 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
25244 PyCFunctionObject*
f = (PyCFunctionObject*)func;
25245 PyCFunction meth =
f->m_ml->ml_meth;
25247 switch (
f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
25249 if (likely(kw == NULL || PyDict_Size(kw) == 0))
25250 return (*meth)(
self, arg);
25252 case METH_VARARGS | METH_KEYWORDS:
25253 return (*(PyCFunctionWithKeywords)meth)(
self, arg, kw);
25255 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25256 size = PyTuple_GET_SIZE(arg);
25257 if (likely(size == 0))
25258 return (*meth)(
self, NULL);
25259 PyErr_Format(PyExc_TypeError,
25260 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25261 f->m_ml->ml_name, size);
25266 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
25267 size = PyTuple_GET_SIZE(arg);
25268 if (likely(size == 1)) {
25269 PyObject *result, *arg0;
25270 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25271 arg0 = PyTuple_GET_ITEM(arg, 0);
25273 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
25275 result = (*meth)(
self, arg0);
25276 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
25281 PyErr_Format(PyExc_TypeError,
25282 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
25283 f->m_ml->ml_name, size);
25288 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
25289 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
25290 "longer supported!");
25293 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
25297 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
25298 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
25300 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
25302 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
25303 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
25305 PyObject *new_args;
25307 argc = PyTuple_GET_SIZE(args);
25308 new_args = PyTuple_GetSlice(args, 1, argc);
25309 if (unlikely(!new_args))
25311 self = PyTuple_GetItem(args, 0);
25312 if (unlikely(!
self)) {
25313 Py_DECREF(new_args);
25316 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
25317 Py_DECREF(new_args);
25319 result = __Pyx_CyFunction_Call(func, args, kw);
25323 static PyTypeObject __pyx_CyFunctionType_type = {
25324 PyVarObject_HEAD_INIT(0, 0)
25325 "cython_function_or_method",
25326 sizeof(__pyx_CyFunctionObject),
25328 (destructor) __Pyx_CyFunction_dealloc,
25332 #if PY_MAJOR_VERSION < 3
25337 (reprfunc) __Pyx_CyFunction_repr,
25342 __Pyx_CyFunction_CallAsMethod,
25347 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
25349 (traverseproc) __Pyx_CyFunction_traverse,
25350 (inquiry) __Pyx_CyFunction_clear,
25352 #
if PY_VERSION_HEX < 0x030500A0
25353 offsetof(__pyx_CyFunctionObject, func_weakreflist),
25355 offsetof(PyCFunctionObject, m_weakreflist),
25359 __pyx_CyFunction_methods,
25360 __pyx_CyFunction_members,
25361 __pyx_CyFunction_getsets,
25364 __Pyx_CyFunction_descr_get,
25366 offsetof(__pyx_CyFunctionObject, func_dict),
25379 #if PY_VERSION_HEX >= 0x030400a1
25383 static int __pyx_CyFunction_init(
void) {
25384 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
25385 if (unlikely(__pyx_CyFunctionType == NULL)) {
25390 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
25391 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25392 m->defaults = PyObject_Malloc(size);
25393 if (unlikely(!m->defaults))
25394 return PyErr_NoMemory();
25395 memset(m->defaults, 0, size);
25396 m->defaults_pyobjects = pyobjects;
25397 return m->defaults;
25399 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
25400 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25401 m->defaults_tuple = tuple;
25404 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
25405 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25406 m->defaults_kwdict = dict;
25409 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
25410 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25411 m->func_annotations = dict;
25416 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
25417 Py_ssize_t cstart, Py_ssize_t cstop,
25418 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
25419 int has_cstart,
int has_cstop, CYTHON_UNUSED
int wraparound) {
25420 #if CYTHON_USE_TYPE_SLOTS
25421 PyMappingMethods* mp;
25422 #if PY_MAJOR_VERSION < 3
25423 PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
25424 if (likely(ms && ms->sq_slice)) {
25426 if (_py_start && (*_py_start != Py_None)) {
25427 cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
25428 if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
25433 if (_py_stop && (*_py_stop != Py_None)) {
25434 cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
25435 if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred())
goto bad;
25437 cstop = PY_SSIZE_T_MAX;
25439 if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
25440 Py_ssize_t l = ms->sq_length(obj);
25441 if (likely(l >= 0)) {
25444 if (cstop < 0) cstop = 0;
25448 if (cstart < 0) cstart = 0;
25451 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
25456 return ms->sq_slice(obj, cstart, cstop);
25459 mp = Py_TYPE(obj)->tp_as_mapping;
25460 if (likely(mp && mp->mp_subscript))
25464 PyObject *py_slice, *py_start, *py_stop;
25466 py_slice = *_py_slice;
25468 PyObject* owned_start = NULL;
25469 PyObject* owned_stop = NULL;
25471 py_start = *_py_start;
25474 owned_start = py_start = PyInt_FromSsize_t(cstart);
25475 if (unlikely(!py_start))
goto bad;
25477 py_start = Py_None;
25480 py_stop = *_py_stop;
25483 owned_stop = py_stop = PyInt_FromSsize_t(cstop);
25484 if (unlikely(!py_stop)) {
25485 Py_XDECREF(owned_start);
25491 py_slice = PySlice_New(py_start, py_stop, Py_None);
25492 Py_XDECREF(owned_start);
25493 Py_XDECREF(owned_stop);
25494 if (unlikely(!py_slice))
goto bad;
25496 #if CYTHON_USE_TYPE_SLOTS
25497 result = mp->mp_subscript(obj, py_slice);
25499 result = PyObject_GetItem(obj, py_slice);
25502 Py_DECREF(py_slice);
25506 PyErr_Format(PyExc_TypeError,
25507 "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
25513 #if PY_MAJOR_VERSION < 3
25514 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
25515 CYTHON_UNUSED PyObject *cause) {
25516 __Pyx_PyThreadState_declare
25518 if (!value || value == Py_None)
25522 if (!tb || tb == Py_None)
25526 if (!PyTraceBack_Check(tb)) {
25527 PyErr_SetString(PyExc_TypeError,
25528 "raise: arg 3 must be a traceback or None");
25532 if (PyType_Check(type)) {
25533 #if CYTHON_COMPILING_IN_PYPY
25535 Py_INCREF(Py_None);
25539 PyErr_NormalizeException(&type, &value, &tb);
25542 PyErr_SetString(PyExc_TypeError,
25543 "instance exception may not have a separate value");
25547 type = (PyObject*) Py_TYPE(type);
25549 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
25550 PyErr_SetString(PyExc_TypeError,
25551 "raise: exception class must be a subclass of BaseException");
25555 __Pyx_PyThreadState_assign
25556 __Pyx_ErrRestore(type, value, tb);
25565 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25566 PyObject* owned_instance = NULL;
25567 if (tb == Py_None) {
25569 }
else if (tb && !PyTraceBack_Check(tb)) {
25570 PyErr_SetString(PyExc_TypeError,
25571 "raise: arg 3 must be a traceback or None");
25574 if (value == Py_None)
25576 if (PyExceptionInstance_Check(type)) {
25578 PyErr_SetString(PyExc_TypeError,
25579 "instance exception may not have a separate value");
25583 type = (PyObject*) Py_TYPE(value);
25584 }
else if (PyExceptionClass_Check(type)) {
25585 PyObject *instance_class = NULL;
25586 if (value && PyExceptionInstance_Check(value)) {
25587 instance_class = (PyObject*) Py_TYPE(value);
25588 if (instance_class != type) {
25589 int is_subclass = PyObject_IsSubclass(instance_class, type);
25590 if (!is_subclass) {
25591 instance_class = NULL;
25592 }
else if (unlikely(is_subclass == -1)) {
25595 type = instance_class;
25599 if (!instance_class) {
25602 args = PyTuple_New(0);
25603 else if (PyTuple_Check(value)) {
25607 args = PyTuple_Pack(1, value);
25610 owned_instance = PyObject_Call(type, args, NULL);
25612 if (!owned_instance)
25614 value = owned_instance;
25615 if (!PyExceptionInstance_Check(value)) {
25616 PyErr_Format(PyExc_TypeError,
25617 "calling %R should have returned an instance of "
25618 "BaseException, not %R",
25619 type, Py_TYPE(value));
25624 PyErr_SetString(PyExc_TypeError,
25625 "raise: exception class must be a subclass of BaseException");
25629 PyObject *fixed_cause;
25630 if (cause == Py_None) {
25631 fixed_cause = NULL;
25632 }
else if (PyExceptionClass_Check(cause)) {
25633 fixed_cause = PyObject_CallObject(cause, NULL);
25634 if (fixed_cause == NULL)
25636 }
else if (PyExceptionInstance_Check(cause)) {
25637 fixed_cause = cause;
25638 Py_INCREF(fixed_cause);
25640 PyErr_SetString(PyExc_TypeError,
25641 "exception causes must derive from "
25645 PyException_SetCause(value, fixed_cause);
25647 PyErr_SetObject(type, value);
25649 #if CYTHON_COMPILING_IN_PYPY
25650 PyObject *tmp_type, *tmp_value, *tmp_tb;
25651 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25653 PyErr_Restore(tmp_type, tmp_value, tb);
25654 Py_XDECREF(tmp_tb);
25656 PyThreadState *tstate = __Pyx_PyThreadState_Current;
25657 PyObject* tmp_tb = tstate->curexc_traceback;
25658 if (tb != tmp_tb) {
25660 tstate->curexc_traceback = tb;
25661 Py_XDECREF(tmp_tb);
25666 Py_XDECREF(owned_instance);
25672 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *
n) {
25674 if (unlikely(!__Pyx_PyBaseString_Check(
n))) {
25675 PyErr_SetString(PyExc_TypeError,
25676 "hasattr(): attribute name must be string");
25679 r = __Pyx_GetAttr(o,
n);
25680 if (unlikely(!
r)) {
25690 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25691 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25693 value = PyDict_GetItemWithError(d, key);
25694 if (unlikely(!value)) {
25695 if (!PyErr_Occurred()) {
25696 PyObject* args = PyTuple_Pack(1, key);
25698 PyErr_SetObject(PyExc_KeyError, args);
25709 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25710 PyErr_Format(PyExc_ValueError,
25711 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
25715 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25716 PyErr_Format(PyExc_ValueError,
25717 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
25718 index, (index == 1) ?
"" :
"s");
25722 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
25723 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
25727 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25728 if (unlikely(!type)) {
25729 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25732 if (likely(__Pyx_TypeCheck(obj, type)))
25734 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25735 Py_TYPE(obj)->tp_name, type->tp_name);
25740 #if CYTHON_FAST_THREAD_STATE
25741 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25742 #if PY_VERSION_HEX >= 0x030700A3
25743 *type = tstate->exc_state.exc_type;
25744 *value = tstate->exc_state.exc_value;
25745 *tb = tstate->exc_state.exc_traceback;
25747 *type = tstate->exc_type;
25748 *value = tstate->exc_value;
25749 *tb = tstate->exc_traceback;
25752 Py_XINCREF(*value);
25755 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25756 PyObject *tmp_type, *tmp_value, *tmp_tb;
25757 #if PY_VERSION_HEX >= 0x030700A3
25758 tmp_type = tstate->exc_state.exc_type;
25759 tmp_value = tstate->exc_state.exc_value;
25760 tmp_tb = tstate->exc_state.exc_traceback;
25761 tstate->exc_state.exc_type = type;
25762 tstate->exc_state.exc_value = value;
25763 tstate->exc_state.exc_traceback = tb;
25765 tmp_type = tstate->exc_type;
25766 tmp_value = tstate->exc_value;
25767 tmp_tb = tstate->exc_traceback;
25768 tstate->exc_type = type;
25769 tstate->exc_value = value;
25770 tstate->exc_traceback = tb;
25772 Py_XDECREF(tmp_type);
25773 Py_XDECREF(tmp_value);
25774 Py_XDECREF(tmp_tb);
25779 #if CYTHON_FAST_THREAD_STATE
25780 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25782 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25784 PyObject *local_type, *local_value, *local_tb;
25785 #if CYTHON_FAST_THREAD_STATE
25786 PyObject *tmp_type, *tmp_value, *tmp_tb;
25787 local_type = tstate->curexc_type;
25788 local_value = tstate->curexc_value;
25789 local_tb = tstate->curexc_traceback;
25790 tstate->curexc_type = 0;
25791 tstate->curexc_value = 0;
25792 tstate->curexc_traceback = 0;
25794 PyErr_Fetch(&local_type, &local_value, &local_tb);
25796 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25797 #if CYTHON_FAST_THREAD_STATE
25798 if (unlikely(tstate->curexc_type))
25800 if (unlikely(PyErr_Occurred()))
25803 #if PY_MAJOR_VERSION >= 3
25805 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25809 Py_XINCREF(local_tb);
25810 Py_XINCREF(local_type);
25811 Py_XINCREF(local_value);
25812 *type = local_type;
25813 *value = local_value;
25815 #if CYTHON_FAST_THREAD_STATE
25816 #if PY_VERSION_HEX >= 0x030700A3
25817 tmp_type = tstate->exc_state.exc_type;
25818 tmp_value = tstate->exc_state.exc_value;
25819 tmp_tb = tstate->exc_state.exc_traceback;
25820 tstate->exc_state.exc_type = local_type;
25821 tstate->exc_state.exc_value = local_value;
25822 tstate->exc_state.exc_traceback = local_tb;
25824 tmp_type = tstate->exc_type;
25825 tmp_value = tstate->exc_value;
25826 tmp_tb = tstate->exc_traceback;
25827 tstate->exc_type = local_type;
25828 tstate->exc_value = local_value;
25829 tstate->exc_traceback = local_tb;
25831 Py_XDECREF(tmp_type);
25832 Py_XDECREF(tmp_value);
25833 Py_XDECREF(tmp_tb);
25835 PyErr_SetExcInfo(local_type, local_value, local_tb);
25842 Py_XDECREF(local_type);
25843 Py_XDECREF(local_value);
25844 Py_XDECREF(local_tb);
25849 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
25851 if (unlikely(!type)) {
25852 PyErr_SetString(PyExc_SystemError,
"Missing type object");
25856 #if PY_MAJOR_VERSION == 2
25857 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
25861 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
25863 PyErr_Format(PyExc_TypeError,
25864 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25865 name, type->tp_name, Py_TYPE(obj)->tp_name);
25870 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
25871 #if CYTHON_COMPILING_IN_PYPY
25872 return PyObject_RichCompareBool(s1, s2, equals);
25875 return (equals == Py_EQ);
25876 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25877 const char *ps1, *ps2;
25878 Py_ssize_t length = PyBytes_GET_SIZE(s1);
25879 if (length != PyBytes_GET_SIZE(s2))
25880 return (equals == Py_NE);
25881 ps1 = PyBytes_AS_STRING(s1);
25882 ps2 = PyBytes_AS_STRING(s2);
25883 if (ps1[0] != ps2[0]) {
25884 return (equals == Py_NE);
25885 }
else if (length == 1) {
25886 return (equals == Py_EQ);
25889 #if CYTHON_USE_UNICODE_INTERNALS
25890 Py_hash_t hash1, hash2;
25891 hash1 = ((PyBytesObject*)s1)->ob_shash;
25892 hash2 = ((PyBytesObject*)s2)->ob_shash;
25893 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25894 return (equals == Py_NE);
25897 result = memcmp(ps1, ps2, (
size_t)length);
25898 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25900 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25901 return (equals == Py_NE);
25902 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25903 return (equals == Py_NE);
25906 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25909 result = __Pyx_PyObject_IsTrue(py_result);
25910 Py_DECREF(py_result);
25917 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
25918 #if CYTHON_COMPILING_IN_PYPY
25919 return PyObject_RichCompareBool(s1, s2, equals);
25921 #if PY_MAJOR_VERSION < 3
25922 PyObject* owned_ref = NULL;
25924 int s1_is_unicode, s2_is_unicode;
25928 s1_is_unicode = PyUnicode_CheckExact(s1);
25929 s2_is_unicode = PyUnicode_CheckExact(s2);
25930 #if PY_MAJOR_VERSION < 3
25931 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25932 owned_ref = PyUnicode_FromObject(s2);
25933 if (unlikely(!owned_ref))
25937 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25938 owned_ref = PyUnicode_FromObject(s1);
25939 if (unlikely(!owned_ref))
25943 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25944 return __Pyx_PyBytes_Equals(s1, s2, equals);
25947 if (s1_is_unicode & s2_is_unicode) {
25950 void *data1, *data2;
25951 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25953 length = __Pyx_PyUnicode_GET_LENGTH(s1);
25954 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25957 #if CYTHON_USE_UNICODE_INTERNALS
25959 Py_hash_t hash1, hash2;
25960 #if CYTHON_PEP393_ENABLED
25961 hash1 = ((PyASCIIObject*)s1)->hash;
25962 hash2 = ((PyASCIIObject*)s2)->hash;
25964 hash1 = ((PyUnicodeObject*)s1)->hash;
25965 hash2 = ((PyUnicodeObject*)s2)->hash;
25967 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25972 kind = __Pyx_PyUnicode_KIND(s1);
25973 if (kind != __Pyx_PyUnicode_KIND(s2)) {
25976 data1 = __Pyx_PyUnicode_DATA(s1);
25977 data2 = __Pyx_PyUnicode_DATA(s2);
25978 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25980 }
else if (length == 1) {
25983 int result = memcmp(data1, data2, (
size_t)(length * kind));
25984 #if PY_MAJOR_VERSION < 3
25985 Py_XDECREF(owned_ref);
25987 return (equals == Py_EQ) ? (result == 0) : (result != 0);
25989 }
else if ((s1 == Py_None) & s2_is_unicode) {
25991 }
else if ((s2 == Py_None) & s1_is_unicode) {
25995 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25996 #if PY_MAJOR_VERSION < 3
25997 Py_XDECREF(owned_ref);
26001 result = __Pyx_PyObject_IsTrue(py_result);
26002 Py_DECREF(py_result);
26006 #if PY_MAJOR_VERSION < 3
26007 Py_XDECREF(owned_ref);
26009 return (equals == Py_EQ);
26011 #if PY_MAJOR_VERSION < 3
26012 Py_XDECREF(owned_ref);
26014 return (equals == Py_NE);
26019 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
26020 Py_ssize_t
q = a / b;
26021 Py_ssize_t
r = a -
q*b;
26022 q -= ((
r != 0) & ((
r ^ b) < 0));
26027 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
26028 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
26029 const char* encoding,
const char* errors,
26030 PyObject* (*decode_func)(
const char *
s, Py_ssize_t size,
const char *errors)) {
26032 if (unlikely((start < 0) | (stop < 0))) {
26033 size_t slen = strlen(cstring);
26034 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
26035 PyErr_SetString(PyExc_OverflowError,
26036 "c-string too long to convert to Python");
26039 length = (Py_ssize_t) slen;
26048 length = stop - start;
26049 if (unlikely(length <= 0))
26050 return PyUnicode_FromUnicode(NULL, 0);
26053 return decode_func(cstring, length, errors);
26055 return PyUnicode_Decode(cstring, length, encoding, errors);
26060 #if CYTHON_FAST_THREAD_STATE
26061 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26062 PyObject *tmp_type, *tmp_value, *tmp_tb;
26063 #if PY_VERSION_HEX >= 0x030700A3
26064 tmp_type = tstate->exc_state.exc_type;
26065 tmp_value = tstate->exc_state.exc_value;
26066 tmp_tb = tstate->exc_state.exc_traceback;
26067 tstate->exc_state.exc_type = *type;
26068 tstate->exc_state.exc_value = *value;
26069 tstate->exc_state.exc_traceback = *tb;
26071 tmp_type = tstate->exc_type;
26072 tmp_value = tstate->exc_value;
26073 tmp_tb = tstate->exc_traceback;
26074 tstate->exc_type = *type;
26075 tstate->exc_value = *value;
26076 tstate->exc_traceback = *tb;
26079 *value = tmp_value;
26083 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
26084 PyObject *tmp_type, *tmp_value, *tmp_tb;
26085 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
26086 PyErr_SetExcInfo(*type, *value, *tb);
26088 *value = tmp_value;
26094 #if CYTHON_COMPILING_IN_CPYTHON
26095 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
26101 return b == &PyBaseObject_Type;
26103 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
26105 if (a == b)
return 1;
26109 n = PyTuple_GET_SIZE(mro);
26110 for (i = 0; i <
n; i++) {
26111 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
26116 return __Pyx_InBases(a, b);
26118 #if PY_MAJOR_VERSION == 2
26119 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
26120 PyObject *exception, *value, *tb;
26122 __Pyx_PyThreadState_declare
26123 __Pyx_PyThreadState_assign
26124 __Pyx_ErrFetch(&exception, &value, &tb);
26125 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
26126 if (unlikely(res == -1)) {
26127 PyErr_WriteUnraisable(err);
26131 res = PyObject_IsSubclass(err, exc_type2);
26132 if (unlikely(res == -1)) {
26133 PyErr_WriteUnraisable(err);
26137 __Pyx_ErrRestore(exception, value, tb);
26141 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
26142 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
26144 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
26149 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
26151 assert(PyExceptionClass_Check(exc_type));
26152 n = PyTuple_GET_SIZE(tuple);
26153 #if PY_MAJOR_VERSION >= 3
26154 for (i=0; i<
n; i++) {
26155 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
26158 for (i=0; i<
n; i++) {
26159 PyObject *t = PyTuple_GET_ITEM(tuple, i);
26160 #if PY_MAJOR_VERSION < 3
26161 if (likely(exc_type == t))
return 1;
26163 if (likely(PyExceptionClass_Check(t))) {
26164 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
26170 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
26171 if (likely(err == exc_type))
return 1;
26172 if (likely(PyExceptionClass_Check(err))) {
26173 if (likely(PyExceptionClass_Check(exc_type))) {
26174 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
26175 }
else if (likely(PyTuple_Check(exc_type))) {
26176 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
26180 return PyErr_GivenExceptionMatches(err, exc_type);
26182 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
26183 assert(PyExceptionClass_Check(exc_type1));
26184 assert(PyExceptionClass_Check(exc_type2));
26185 if (likely(err == exc_type1 || err == exc_type2))
return 1;
26186 if (likely(PyExceptionClass_Check(err))) {
26187 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
26189 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
26194 #if !CYTHON_COMPILING_IN_PYPY
26195 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
int inplace) {
26196 #if PY_MAJOR_VERSION < 3
26197 if (likely(PyInt_CheckExact(op1))) {
26198 const long b = intval;
26200 long a = PyInt_AS_LONG(op1);
26201 x = (long)((
unsigned long)a + b);
26202 if (likely((x^a) >= 0 || (x^b) >= 0))
26203 return PyInt_FromLong(x);
26204 return PyLong_Type.tp_as_number->nb_add(op1, op2);
26207 #if CYTHON_USE_PYLONG_INTERNALS
26208 if (likely(PyLong_CheckExact(op1))) {
26209 const long b = intval;
26211 #ifdef HAVE_LONG_LONG
26212 const PY_LONG_LONG llb = intval;
26213 PY_LONG_LONG lla, llx;
26215 const digit* digits = ((PyLongObject*)op1)->ob_digit;
26216 const Py_ssize_t size = Py_SIZE(op1);
26217 if (likely(__Pyx_sst_abs(size) <= 1)) {
26218 a = likely(size) ? digits[0] : 0;
26219 if (size == -1) a = -a;
26223 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26224 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26226 #ifdef HAVE_LONG_LONG
26227 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26228 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26232 CYTHON_FALLTHROUGH;
26234 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
26235 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26237 #ifdef HAVE_LONG_LONG
26238 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
26239 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26243 CYTHON_FALLTHROUGH;
26245 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26246 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26248 #ifdef HAVE_LONG_LONG
26249 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26250 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26254 CYTHON_FALLTHROUGH;
26256 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
26257 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26259 #ifdef HAVE_LONG_LONG
26260 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
26261 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26265 CYTHON_FALLTHROUGH;
26267 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26268 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26270 #ifdef HAVE_LONG_LONG
26271 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26272 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26276 CYTHON_FALLTHROUGH;
26278 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
26279 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
26281 #ifdef HAVE_LONG_LONG
26282 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
26283 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
26287 CYTHON_FALLTHROUGH;
26288 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
26292 return PyLong_FromLong(x);
26293 #ifdef HAVE_LONG_LONG
26296 return PyLong_FromLongLong(llx);
26302 if (PyFloat_CheckExact(op1)) {
26303 const long b = intval;
26304 double a = PyFloat_AS_DOUBLE(op1);
26306 PyFPE_START_PROTECT(
"add",
return NULL)
26307 result = ((double)a) + (double)b;
26308 PyFPE_END_PROTECT(result)
26309 return PyFloat_FromDouble(result);
26311 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
26316 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
26317 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
26321 static CYTHON_INLINE
long __Pyx_div_long(
long a,
long b) {
26324 q -= ((
r != 0) & ((
r ^ b) < 0));
26329 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26330 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
26331 PyErr_Format(PyExc_AttributeError,
26332 #
if PY_MAJOR_VERSION >= 3
26333 "'%.50s' object has no attribute '%U'",
26334 tp->tp_name, attr_name);
26336 "'%.50s' object has no attribute '%.400s'",
26337 tp->tp_name, PyString_AS_STRING(attr_name));
26341 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
26343 PyTypeObject *tp = Py_TYPE(obj);
26344 if (unlikely(!PyString_Check(attr_name))) {
26345 return PyObject_GenericGetAttr(obj, attr_name);
26347 assert(!tp->tp_dictoffset);
26348 descr = _PyType_Lookup(tp, attr_name);
26349 if (unlikely(!descr)) {
26350 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
26353 #if PY_MAJOR_VERSION < 3
26354 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
26357 descrgetfunc
f = Py_TYPE(descr)->tp_descr_get;
26359 PyObject *res =
f(descr, obj, (PyObject *)tp);
26369 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
26370 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
26371 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
26372 return PyObject_GenericGetAttr(obj, attr_name);
26374 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
26379 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
26381 PyObject *name_attr;
26382 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
26383 if (likely(name_attr)) {
26384 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
26388 if (unlikely(ret < 0)) {
26392 Py_XDECREF(name_attr);
26395 static int __Pyx_setup_reduce(PyObject* type_obj) {
26397 PyObject *object_reduce = NULL;
26398 PyObject *object_reduce_ex = NULL;
26399 PyObject *reduce = NULL;
26400 PyObject *reduce_ex = NULL;
26401 PyObject *reduce_cython = NULL;
26402 PyObject *setstate = NULL;
26403 PyObject *setstate_cython = NULL;
26404 #if CYTHON_USE_PYTYPE_LOOKUP
26405 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto GOOD;
26407 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto GOOD;
26409 #if CYTHON_USE_PYTYPE_LOOKUP
26410 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
26412 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto BAD;
26414 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto BAD;
26415 if (reduce_ex == object_reduce_ex) {
26416 #if CYTHON_USE_PYTYPE_LOOKUP
26417 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
26419 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto BAD;
26421 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto BAD;
26422 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
26423 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython);
if (unlikely(!reduce_cython))
goto BAD;
26424 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto BAD;
26425 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto BAD;
26426 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
26427 if (!setstate) PyErr_Clear();
26428 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
26429 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython);
if (unlikely(!setstate_cython))
goto BAD;
26430 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto BAD;
26431 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto BAD;
26433 PyType_Modified((PyTypeObject*)type_obj);
26438 if (!PyErr_Occurred())
26439 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
26442 #if !CYTHON_USE_PYTYPE_LOOKUP
26443 Py_XDECREF(object_reduce);
26444 Py_XDECREF(object_reduce_ex);
26446 Py_XDECREF(reduce);
26447 Py_XDECREF(reduce_ex);
26448 Py_XDECREF(reduce_cython);
26449 Py_XDECREF(setstate);
26450 Py_XDECREF(setstate_cython);
26455 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
26456 #if PY_VERSION_HEX >= 0x02070000
26457 PyObject *ob = PyCapsule_New(vtable, 0, 0);
26459 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
26463 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
26473 #ifndef CYTHON_CLINE_IN_TRACEBACK
26474 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate,
int c_line) {
26475 PyObject *use_cline;
26476 PyObject *ptype, *pvalue, *ptraceback;
26477 #if CYTHON_COMPILING_IN_CPYTHON
26478 PyObject **cython_runtime_dict;
26480 if (unlikely(!__pyx_cython_runtime)) {
26483 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26484 #if CYTHON_COMPILING_IN_CPYTHON
26485 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26486 if (likely(cython_runtime_dict)) {
26487 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
26491 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26492 if (use_cline_obj) {
26493 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26494 Py_DECREF(use_cline_obj);
26502 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26504 else if (PyObject_Not(use_cline) != 0) {
26507 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26513 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26514 int start = 0, mid = 0, end = count - 1;
26515 if (end >= 0 && code_line > entries[end].code_line) {
26518 while (start < end) {
26519 mid = start + (end - start) / 2;
26520 if (code_line < entries[mid].code_line) {
26522 }
else if (code_line > entries[mid].code_line) {
26528 if (code_line <= entries[mid].code_line) {
26534 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26535 PyCodeObject* code_object;
26537 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26540 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26541 if (unlikely(
pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[
pos].code_line != code_line)) {
26544 code_object = __pyx_code_cache.entries[
pos].code_object;
26545 Py_INCREF(code_object);
26546 return code_object;
26548 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26550 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26551 if (unlikely(!code_line)) {
26554 if (unlikely(!entries)) {
26555 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26556 if (likely(entries)) {
26557 __pyx_code_cache.entries = entries;
26558 __pyx_code_cache.max_count = 64;
26559 __pyx_code_cache.count = 1;
26560 entries[0].code_line = code_line;
26561 entries[0].code_object = code_object;
26562 Py_INCREF(code_object);
26566 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26567 if ((
pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[
pos].code_line == code_line)) {
26568 PyCodeObject* tmp = entries[
pos].code_object;
26569 entries[
pos].code_object = code_object;
26573 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26574 int new_max = __pyx_code_cache.max_count + 64;
26575 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26576 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
26577 if (unlikely(!entries)) {
26580 __pyx_code_cache.entries = entries;
26581 __pyx_code_cache.max_count = new_max;
26583 for (i=__pyx_code_cache.count; i>
pos; i--) {
26584 entries[i] = entries[i-1];
26586 entries[
pos].code_line = code_line;
26587 entries[
pos].code_object = code_object;
26588 __pyx_code_cache.count++;
26589 Py_INCREF(code_object);
26593 #include "compile.h"
26594 #include "frameobject.h"
26595 #include "traceback.h"
26596 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26597 const char *funcname,
int c_line,
26598 int py_line,
const char *filename) {
26599 PyCodeObject *py_code = 0;
26600 PyObject *py_srcfile = 0;
26601 PyObject *py_funcname = 0;
26602 #if PY_MAJOR_VERSION < 3
26603 py_srcfile = PyString_FromString(filename);
26605 py_srcfile = PyUnicode_FromString(filename);
26607 if (!py_srcfile)
goto bad;
26609 #if PY_MAJOR_VERSION < 3
26610 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26612 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26616 #if PY_MAJOR_VERSION < 3
26617 py_funcname = PyString_FromString(funcname);
26619 py_funcname = PyUnicode_FromString(funcname);
26622 if (!py_funcname)
goto bad;
26623 py_code = __Pyx_PyCode_New(
26640 Py_DECREF(py_srcfile);
26641 Py_DECREF(py_funcname);
26644 Py_XDECREF(py_srcfile);
26645 Py_XDECREF(py_funcname);
26648 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26649 int py_line,
const char *filename) {
26650 PyCodeObject *py_code = 0;
26651 PyFrameObject *py_frame = 0;
26652 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26654 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26656 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26658 py_code = __Pyx_CreateCodeObjectForTraceback(
26659 funcname, c_line, py_line, filename);
26660 if (!py_code)
goto bad;
26661 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26663 py_frame = PyFrame_New(
26669 if (!py_frame)
goto bad;
26670 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26671 PyTraceBack_Here(py_frame);
26673 Py_XDECREF(py_code);
26674 Py_XDECREF(py_frame);
26677 #if PY_MAJOR_VERSION < 3
26678 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26679 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26680 if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26681 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26682 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26683 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26686 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26687 PyObject *obj = view->obj;
26689 if (PyObject_CheckBuffer(obj)) {
26690 PyBuffer_Release(view);
26694 else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26703 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26705 int i, index, step, start;
26706 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26707 if (order ==
'F') {
26714 for (i = 0; i < ndim; i++) {
26715 index = start + step * i;
26716 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26718 itemsize *= mvs.shape[index];
26725 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26726 void **out_start,
void **out_end,
26727 int ndim,
size_t itemsize)
26731 start = end = slice->data;
26732 for (i = 0; i < ndim; i++) {
26733 Py_ssize_t stride = slice->strides[i];
26734 Py_ssize_t extent = slice->shape[i];
26736 *out_start = *out_end = start;
26740 end += stride * (extent - 1);
26742 start += stride * (extent - 1);
26745 *out_start = start;
26746 *out_end = end + itemsize;
26749 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26750 __Pyx_memviewslice *slice2,
26751 int ndim,
size_t itemsize)
26753 void *start1, *end1, *start2, *end2;
26754 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26755 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26756 return (start1 < end2) && (start2 < end1);
26760 static CYTHON_INLINE PyObject *
26761 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26764 #if PY_VERSION_HEX >= 0x02070000
26765 cobj = PyCapsule_New(p, sig, NULL);
26767 cobj = PyCObject_FromVoidPtr(p, NULL);
26773 static CYTHON_INLINE PyObject *__pyx_memview_get_double(
const char *itemp) {
26774 return (PyObject *) PyFloat_FromDouble(*(
double *) itemp);
26776 static CYTHON_INLINE
int __pyx_memview_set_double(
const char *itemp, PyObject *obj) {
26777 double value = __pyx_PyFloat_AsDouble(obj);
26778 if ((value == (
double)-1) && PyErr_Occurred())
26780 *(
double *) itemp = value;
26785 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26791 S.u32 = 0x01020304;
26792 return S.u8[0] == 4;
26796 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26797 __Pyx_BufFmt_StackElem* stack,
26798 __Pyx_TypeInfo* type) {
26799 stack[0].field = &ctx->root;
26800 stack[0].parent_offset = 0;
26801 ctx->root.type = type;
26802 ctx->root.name =
"buffer dtype";
26803 ctx->root.offset = 0;
26805 ctx->head->field = &ctx->root;
26806 ctx->fmt_offset = 0;
26807 ctx->head->parent_offset = 0;
26808 ctx->new_packmode =
'@';
26809 ctx->enc_packmode =
'@';
26810 ctx->new_count = 1;
26811 ctx->enc_count = 0;
26813 ctx->is_complex = 0;
26814 ctx->is_valid_array = 0;
26815 ctx->struct_alignment = 0;
26816 while (type->typegroup ==
'S') {
26818 ctx->head->field = type->fields;
26819 ctx->head->parent_offset = 0;
26820 type = type->fields->type;
26823 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26825 const char* t = *ts;
26826 if (*t < '0' || *t >
'9') {
26829 count = *t++ -
'0';
26830 while (*t >=
'0' && *t <
'9') {
26832 count += *t++ -
'0';
26838 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26839 int number = __Pyx_BufFmt_ParseNumber(ts);
26841 PyErr_Format(PyExc_ValueError,\
26842 "Does not understand character buffer dtype format string ('%c')", **ts);
26845 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26846 PyErr_Format(PyExc_ValueError,
26847 "Unexpected format string character: '%c'", ch);
26849 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26851 case 'c':
return "'char'";
26852 case 'b':
return "'signed char'";
26853 case 'B':
return "'unsigned char'";
26854 case 'h':
return "'short'";
26855 case 'H':
return "'unsigned short'";
26856 case 'i':
return "'int'";
26857 case 'I':
return "'unsigned int'";
26858 case 'l':
return "'long'";
26859 case 'L':
return "'unsigned long'";
26860 case 'q':
return "'long long'";
26861 case 'Q':
return "'unsigned long long'";
26862 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26863 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26864 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26865 case 'T':
return "a struct";
26866 case 'O':
return "Python object";
26867 case 'P':
return "a pointer";
26868 case 's':
case 'p':
return "a string";
26869 case 0:
return "end";
26870 default:
return "unparseable format string";
26873 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26875 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26876 case 'h':
case 'H':
return 2;
26877 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26878 case 'q':
case 'Q':
return 8;
26879 case 'f':
return (is_complex ? 8 : 4);
26880 case 'd':
return (is_complex ? 16 : 8);
26882 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26885 case 'O':
case 'P':
return sizeof(
void*);
26887 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26891 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26893 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26894 case 'h':
case 'H':
return sizeof(short);
26895 case 'i':
case 'I':
return sizeof(int);
26896 case 'l':
case 'L':
return sizeof(long);
26897 #ifdef HAVE_LONG_LONG
26898 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26900 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26901 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26902 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26903 case 'O':
case 'P':
return sizeof(
void*);
26905 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26910 typedef struct {
char c;
short x; } __Pyx_st_short;
26911 typedef struct {
char c;
int x; } __Pyx_st_int;
26912 typedef struct {
char c;
long x; } __Pyx_st_long;
26913 typedef struct {
char c;
float x; } __Pyx_st_float;
26914 typedef struct {
char c;
double x; } __Pyx_st_double;
26915 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26916 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26917 #ifdef HAVE_LONG_LONG
26918 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26920 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26922 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26923 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26924 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26925 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26926 #ifdef HAVE_LONG_LONG
26927 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26929 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26930 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26931 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26932 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26934 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26942 typedef struct {
short x;
char c; } __Pyx_pad_short;
26943 typedef struct {
int x;
char c; } __Pyx_pad_int;
26944 typedef struct {
long x;
char c; } __Pyx_pad_long;
26945 typedef struct {
float x;
char c; } __Pyx_pad_float;
26946 typedef struct {
double x;
char c; } __Pyx_pad_double;
26947 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26948 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26949 #ifdef HAVE_LONG_LONG
26950 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26952 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26954 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26955 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26956 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26957 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26958 #ifdef HAVE_LONG_LONG
26959 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26961 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26962 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26963 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26964 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26966 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26970 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26974 case 'b':
case 'h':
case 'i':
26975 case 'l':
case 'q':
case 's':
case 'p':
26977 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26979 case 'f':
case 'd':
case 'g':
26980 return (is_complex ?
'C' :
'R');
26986 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26991 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26992 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26993 const char* expected;
26995 if (ctx->head == NULL) {
26999 expected = ctx->head->field->type->name;
27002 PyErr_Format(PyExc_ValueError,
27003 "Buffer dtype mismatch, expected %s%s%s but got %s",
27004 quote, expected, quote,
27005 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
27007 __Pyx_StructField* field = ctx->head->field;
27008 __Pyx_StructField* parent = (ctx->head - 1)->field;
27009 PyErr_Format(PyExc_ValueError,
27010 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
27011 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
27012 parent->type->name, field->name);
27015 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
27017 size_t size, offset, arraysize = 1;
27018 if (ctx->enc_type == 0)
return 0;
27019 if (ctx->head->field->type->arraysize[0]) {
27021 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27022 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27024 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27025 PyErr_Format(PyExc_ValueError,
27026 "Expected a dimension of size %zu, got %zu",
27027 ctx->head->field->type->arraysize[0], ctx->enc_count);
27031 if (!ctx->is_valid_array) {
27032 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27033 ctx->head->field->type->ndim, ndim);
27036 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27037 arraysize *= ctx->head->field->type->arraysize[i];
27039 ctx->is_valid_array = 0;
27040 ctx->enc_count = 1;
27042 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27044 __Pyx_StructField* field = ctx->head->field;
27045 __Pyx_TypeInfo* type = field->type;
27046 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27047 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27049 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27051 if (ctx->enc_packmode ==
'@') {
27052 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27053 size_t align_mod_offset;
27054 if (align_at == 0)
return -1;
27055 align_mod_offset = ctx->fmt_offset % align_at;
27056 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27057 if (ctx->struct_alignment == 0)
27058 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27061 if (type->size != size || type->typegroup != group) {
27062 if (type->typegroup ==
'C' && type->fields != NULL) {
27063 size_t parent_offset = ctx->head->parent_offset + field->offset;
27065 ctx->head->field = type->fields;
27066 ctx->head->parent_offset = parent_offset;
27069 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27071 __Pyx_BufFmt_RaiseExpected(ctx);
27075 offset = ctx->head->parent_offset + field->offset;
27076 if (ctx->fmt_offset != offset) {
27077 PyErr_Format(PyExc_ValueError,
27078 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27079 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27082 ctx->fmt_offset += size;
27084 ctx->fmt_offset += (arraysize - 1) * size;
27087 if (field == &ctx->root) {
27089 if (ctx->enc_count != 0) {
27090 __Pyx_BufFmt_RaiseExpected(ctx);
27095 ctx->head->field = ++field;
27096 if (field->type == NULL) {
27098 field = ctx->head->field;
27100 }
else if (field->type->typegroup ==
'S') {
27101 size_t parent_offset = ctx->head->parent_offset + field->offset;
27102 if (field->type->fields->type == NULL)
continue;
27103 field = field->type->fields;
27105 ctx->head->field = field;
27106 ctx->head->parent_offset = parent_offset;
27112 }
while (ctx->enc_count);
27114 ctx->is_complex = 0;
27118 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27120 const char *ts = *tsp;
27122 int ndim = ctx->head->field->type->ndim;
27125 if (ctx->new_count != 1) {
27126 PyErr_SetString(PyExc_ValueError,
27127 "Cannot handle repeated arrays in format string");
27130 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27131 while (*ts && *ts !=
')') {
27133 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27136 number = __Pyx_BufFmt_ExpectNumber(&ts);
27137 if (
number == -1)
return NULL;
27138 if (i < ndim && (
size_t)
number != ctx->head->field->type->arraysize[i])
27139 return PyErr_Format(PyExc_ValueError,
27140 "Expected a dimension of size %zu, got %d",
27141 ctx->head->field->type->arraysize[i],
number);
27142 if (*ts !=
',' && *ts !=
')')
27143 return PyErr_Format(PyExc_ValueError,
27144 "Expected a comma in format string, got '%c'", *ts);
27145 if (*ts ==
',') ts++;
27149 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27150 ctx->head->field->type->ndim, i);
27152 PyErr_SetString(PyExc_ValueError,
27153 "Unexpected end of format string, expected ')'");
27156 ctx->is_valid_array = 1;
27157 ctx->new_count = 1;
27161 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27166 if (ctx->enc_type != 0 && ctx->head == NULL) {
27167 __Pyx_BufFmt_RaiseExpected(ctx);
27170 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27171 if (ctx->head != NULL) {
27172 __Pyx_BufFmt_RaiseExpected(ctx);
27182 if (!__Pyx_Is_Little_Endian()) {
27183 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27186 ctx->new_packmode =
'=';
27191 if (__Pyx_Is_Little_Endian()) {
27192 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27195 ctx->new_packmode =
'=';
27201 ctx->new_packmode = *ts++;
27205 const char* ts_after_sub;
27206 size_t i, struct_count = ctx->new_count;
27207 size_t struct_alignment = ctx->struct_alignment;
27208 ctx->new_count = 1;
27211 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27214 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27216 ctx->enc_count = 0;
27217 ctx->struct_alignment = 0;
27220 for (i = 0; i != struct_count; ++i) {
27221 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27222 if (!ts_after_sub)
return NULL;
27225 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27230 size_t alignment = ctx->struct_alignment;
27232 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27234 if (alignment && ctx->fmt_offset % alignment) {
27235 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27240 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27241 ctx->fmt_offset += ctx->new_count;
27242 ctx->new_count = 1;
27243 ctx->enc_count = 0;
27245 ctx->enc_packmode = ctx->new_packmode;
27251 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27252 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27255 CYTHON_FALLTHROUGH;
27256 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27257 case 'l':
case 'L':
case 'q':
case 'Q':
27258 case 'f':
case 'd':
case 'g':
27259 case 'O':
case 'p':
27260 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
27261 ctx->enc_packmode == ctx->new_packmode) {
27262 ctx->enc_count += ctx->new_count;
27263 ctx->new_count = 1;
27268 CYTHON_FALLTHROUGH;
27270 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27271 ctx->enc_count = ctx->new_count;
27272 ctx->enc_packmode = ctx->new_packmode;
27273 ctx->enc_type = *ts;
27274 ctx->is_complex = got_Z;
27276 ctx->new_count = 1;
27281 while(*ts !=
':') ++ts;
27285 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27289 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27290 if (
number == -1)
return NULL;
27291 ctx->new_count = (size_t)
number;
27299 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27306 if (a->size != b->size || a->typegroup != b->typegroup ||
27307 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27308 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27309 return a->size == b->size;
27315 for (i = 0; i < a->ndim; i++)
27316 if (a->arraysize[i] != b->arraysize[i])
27319 if (a->typegroup ==
'S') {
27320 if (a->flags != b->flags)
27322 if (a->fields || b->fields) {
27323 if (!(a->fields && b->fields))
27325 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27326 __Pyx_StructField *field_a = a->fields + i;
27327 __Pyx_StructField *field_b = b->fields + i;
27328 if (field_a->offset != field_b->offset ||
27329 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27332 return !a->fields[i].type && !b->fields[i].type;
27340 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27342 if (buf->shape[dim] <= 1)
27344 if (buf->strides) {
27345 if (spec & __Pyx_MEMVIEW_CONTIG) {
27346 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27347 if (buf->strides[dim] !=
sizeof(
void *)) {
27348 PyErr_Format(PyExc_ValueError,
27349 "Buffer is not indirectly contiguous "
27350 "in dimension %d.", dim);
27353 }
else if (buf->strides[dim] != buf->itemsize) {
27354 PyErr_SetString(PyExc_ValueError,
27355 "Buffer and memoryview are not contiguous "
27356 "in the same dimension.");
27360 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27361 Py_ssize_t stride = buf->strides[dim];
27364 if (stride < buf->itemsize) {
27365 PyErr_SetString(PyExc_ValueError,
27366 "Buffer and memoryview are not contiguous "
27367 "in the same dimension.");
27372 if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
27373 PyErr_Format(PyExc_ValueError,
27374 "C-contiguous buffer is not contiguous in "
27375 "dimension %d", dim);
27377 }
else if (spec & (__Pyx_MEMVIEW_PTR)) {
27378 PyErr_Format(PyExc_ValueError,
27379 "C-contiguous buffer is not indirect in "
27380 "dimension %d", dim);
27382 }
else if (buf->suboffsets) {
27383 PyErr_SetString(PyExc_ValueError,
27384 "Buffer exposes suboffsets but no strides");
27393 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27395 if (spec & __Pyx_MEMVIEW_DIRECT) {
27396 if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
27397 PyErr_Format(PyExc_ValueError,
27398 "Buffer not compatible with direct access "
27399 "in dimension %d.", dim);
27403 if (spec & __Pyx_MEMVIEW_PTR) {
27404 if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
27405 PyErr_Format(PyExc_ValueError,
27406 "Buffer is not indirectly accessible "
27407 "in dimension %d.", dim);
27416 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27419 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27420 Py_ssize_t stride = 1;
27421 for (i = 0; i < ndim; i++) {
27422 if (stride * buf->itemsize != buf->strides[i] &&
27425 PyErr_SetString(PyExc_ValueError,
27426 "Buffer not fortran contiguous.");
27429 stride = stride * buf->shape[i];
27431 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27432 Py_ssize_t stride = 1;
27433 for (i = ndim - 1; i >- 1; i--) {
27434 if (stride * buf->itemsize != buf->strides[i] &&
27435 buf->shape[i] > 1) {
27436 PyErr_SetString(PyExc_ValueError,
27437 "Buffer not C contiguous.");
27440 stride = stride * buf->shape[i];
27447 static int __Pyx_ValidateAndInit_memviewslice(
27452 __Pyx_TypeInfo *dtype,
27453 __Pyx_BufFmt_StackElem stack[],
27454 __Pyx_memviewslice *memviewslice,
27455 PyObject *original_obj)
27457 struct __pyx_memoryview_obj *memview, *new_memview;
27458 __Pyx_RefNannyDeclarations
27460 int i, spec = 0, retval = -1;
27461 __Pyx_BufFmt_Context ctx;
27462 int from_memoryview = __pyx_memoryview_check(original_obj);
27463 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27464 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27465 original_obj)->typeinfo)) {
27466 memview = (
struct __pyx_memoryview_obj *) original_obj;
27467 new_memview = NULL;
27469 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27470 original_obj, buf_flags, 0, dtype);
27471 new_memview = memview;
27472 if (unlikely(!memview))
27475 buf = &memview->view;
27476 if (buf->ndim != ndim) {
27477 PyErr_Format(PyExc_ValueError,
27478 "Buffer has wrong number of dimensions (expected %d, got %d)",
27483 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27484 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
27486 if ((
unsigned) buf->itemsize != dtype->size) {
27487 PyErr_Format(PyExc_ValueError,
27488 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27489 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27491 (buf->itemsize > 1) ?
"s" :
"",
27494 (dtype->size > 1) ?
"s" :
"");
27497 for (i = 0; i < ndim; i++) {
27498 spec = axes_specs[i];
27499 if (!__pyx_check_strides(buf, i, ndim, spec))
27501 if (!__pyx_check_suboffsets(buf, i, ndim, spec))
27504 if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
27506 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27507 new_memview != NULL) == -1)) {
27513 Py_XDECREF(new_memview);
27516 __Pyx_RefNannyFinishContext();
27521 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
27522 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27523 __Pyx_BufFmt_StackElem stack[1];
27524 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27526 if (obj == Py_None) {
27527 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27530 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27531 PyBUF_RECORDS_RO | writable_flag, 1,
27532 &__Pyx_TypeInfo_double, stack,
27534 if (unlikely(retcode == -1))
27538 result.memview = NULL;
27539 result.data = NULL;
27544 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
27545 const int neg_one = (int) -1, const_zero = (
int) 0;
27546 const int is_unsigned = neg_one > const_zero;
27548 if (
sizeof(
int) <
sizeof(long)) {
27549 return PyInt_FromLong((
long) value);
27550 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27551 return PyLong_FromUnsignedLong((
unsigned long) value);
27552 #ifdef HAVE_LONG_LONG
27553 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27554 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27558 if (
sizeof(
int) <=
sizeof(
long)) {
27559 return PyInt_FromLong((
long) value);
27560 #ifdef HAVE_LONG_LONG
27561 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27562 return PyLong_FromLongLong((PY_LONG_LONG) value);
27567 int one = 1;
int little = (int)*(
unsigned char *)&one;
27568 unsigned char *bytes = (
unsigned char *)&value;
27569 return _PyLong_FromByteArray(bytes,
sizeof(
int),
27570 little, !is_unsigned);
27575 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27576 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27577 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27578 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27579 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27581 func_type value = func_value;\
27582 if (sizeof(target_type) < sizeof(func_type)) {\
27583 if (unlikely(value != (func_type) (target_type) value)) {\
27584 func_type zero = 0;\
27585 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27586 return (target_type) -1;\
27587 if (is_unsigned && unlikely(value < zero))\
27588 goto raise_neg_overflow;\
27590 goto raise_overflow;\
27593 return (target_type) value;\
27597 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27598 const long neg_one = (long) -1, const_zero = (
long) 0;
27599 const int is_unsigned = neg_one > const_zero;
27601 if (
sizeof(
long) <
sizeof(long)) {
27602 return PyInt_FromLong((
long) value);
27603 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27604 return PyLong_FromUnsignedLong((
unsigned long) value);
27605 #ifdef HAVE_LONG_LONG
27606 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27607 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27611 if (
sizeof(
long) <=
sizeof(
long)) {
27612 return PyInt_FromLong((
long) value);
27613 #ifdef HAVE_LONG_LONG
27614 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27615 return PyLong_FromLongLong((PY_LONG_LONG) value);
27620 int one = 1;
int little = (int)*(
unsigned char *)&one;
27621 unsigned char *bytes = (
unsigned char *)&value;
27622 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27623 little, !is_unsigned);
27628 #if CYTHON_CCOMPLEX
27630 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27631 return ::std::complex< float >(x, y);
27634 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27635 return x + y*(__pyx_t_float_complex)_Complex_I;
27639 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
27640 __pyx_t_float_complex
z;
27648 #if CYTHON_CCOMPLEX
27650 static CYTHON_INLINE
int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27651 return (a.real == b.real) && (a.imag == b.imag);
27653 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27654 __pyx_t_float_complex
z;
27655 z.real = a.real + b.real;
27656 z.imag = a.imag + b.imag;
27659 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27660 __pyx_t_float_complex
z;
27661 z.real = a.real - b.real;
27662 z.imag = a.imag - b.imag;
27665 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27666 __pyx_t_float_complex
z;
27667 z.real = a.real * b.real - a.imag * b.imag;
27668 z.imag = a.real * b.imag + a.imag * b.real;
27672 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27674 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27675 }
else if (fabsf(b.real) >= fabsf(b.imag)) {
27676 if (b.real == 0 && b.imag == 0) {
27677 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27679 float r = b.imag / b.real;
27680 float s = 1.0 / (b.real + b.imag *
r);
27681 return __pyx_t_float_complex_from_parts(
27682 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27685 float r = b.real / b.imag;
27686 float s = 1.0 / (b.imag + b.real *
r);
27687 return __pyx_t_float_complex_from_parts(
27688 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27692 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27694 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27696 float denom = b.real * b.real + b.imag * b.imag;
27697 return __pyx_t_float_complex_from_parts(
27698 (a.real * b.real + a.imag * b.imag) / denom,
27699 (a.imag * b.real - a.real * b.imag) / denom);
27703 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27704 __pyx_t_float_complex
z;
27709 static CYTHON_INLINE
int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27710 return (a.real == 0) && (a.imag == 0);
27712 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27713 __pyx_t_float_complex
z;
27719 static CYTHON_INLINE
float __Pyx_c_abs_float(__pyx_t_float_complex
z) {
27720 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27721 return sqrtf(
z.real*
z.real +
z.imag*
z.imag);
27723 return hypotf(
z.real,
z.imag);
27726 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27727 __pyx_t_float_complex
z;
27728 float r, lnr, theta, z_r, z_theta;
27729 if (b.imag == 0 && b.real == (
int)b.real) {
27731 float denom = a.real * a.real + a.imag * a.imag;
27732 a.real = a.real / denom;
27733 a.imag = -a.imag / denom;
27736 switch ((
int)b.real) {
27744 z = __Pyx_c_prod_float(a, a);
27745 return __Pyx_c_prod_float(a, a);
27747 z = __Pyx_c_prod_float(a, a);
27748 return __Pyx_c_prod_float(
z, a);
27750 z = __Pyx_c_prod_float(a, a);
27751 return __Pyx_c_prod_float(
z,
z);
27757 }
else if (b.imag == 0) {
27758 z.real = powf(a.real, b.real);
27761 }
else if (a.real > 0) {
27766 theta = atan2f(0, -1);
27769 r = __Pyx_c_abs_float(a);
27770 theta = atan2f(a.imag, a.real);
27773 z_r = expf(lnr * b.real - theta * b.imag);
27774 z_theta = theta * b.real + lnr * b.imag;
27775 z.real = z_r * cosf(z_theta);
27776 z.imag = z_r * sinf(z_theta);
27783 #if CYTHON_CCOMPLEX
27785 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27786 return ::std::complex< double >(x, y);
27789 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27790 return x + y*(__pyx_t_double_complex)_Complex_I;
27794 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
27795 __pyx_t_double_complex
z;
27803 #if CYTHON_CCOMPLEX
27805 static CYTHON_INLINE
int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27806 return (a.real == b.real) && (a.imag == b.imag);
27808 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27809 __pyx_t_double_complex
z;
27810 z.real = a.real + b.real;
27811 z.imag = a.imag + b.imag;
27814 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27815 __pyx_t_double_complex
z;
27816 z.real = a.real - b.real;
27817 z.imag = a.imag - b.imag;
27820 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27821 __pyx_t_double_complex
z;
27822 z.real = a.real * b.real - a.imag * b.imag;
27823 z.imag = a.real * b.imag + a.imag * b.real;
27827 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27829 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27830 }
else if (fabs(b.real) >= fabs(b.imag)) {
27831 if (b.real == 0 && b.imag == 0) {
27832 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27834 double r = b.imag / b.real;
27835 double s = 1.0 / (b.real + b.imag *
r);
27836 return __pyx_t_double_complex_from_parts(
27837 (a.real + a.imag *
r) *
s, (a.imag - a.real *
r) *
s);
27840 double r = b.real / b.imag;
27841 double s = 1.0 / (b.imag + b.real *
r);
27842 return __pyx_t_double_complex_from_parts(
27843 (a.real *
r + a.imag) *
s, (a.imag *
r - a.real) *
s);
27847 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27849 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27851 double denom = b.real * b.real + b.imag * b.imag;
27852 return __pyx_t_double_complex_from_parts(
27853 (a.real * b.real + a.imag * b.imag) / denom,
27854 (a.imag * b.real - a.real * b.imag) / denom);
27858 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27859 __pyx_t_double_complex
z;
27864 static CYTHON_INLINE
int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27865 return (a.real == 0) && (a.imag == 0);
27867 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27868 __pyx_t_double_complex
z;
27874 static CYTHON_INLINE
double __Pyx_c_abs_double(__pyx_t_double_complex
z) {
27875 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27876 return sqrt(
z.real*
z.real +
z.imag*
z.imag);
27878 return hypot(
z.real,
z.imag);
27881 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27882 __pyx_t_double_complex
z;
27883 double r, lnr, theta, z_r, z_theta;
27884 if (b.imag == 0 && b.real == (
int)b.real) {
27886 double denom = a.real * a.real + a.imag * a.imag;
27887 a.real = a.real / denom;
27888 a.imag = -a.imag / denom;
27891 switch ((
int)b.real) {
27899 z = __Pyx_c_prod_double(a, a);
27900 return __Pyx_c_prod_double(a, a);
27902 z = __Pyx_c_prod_double(a, a);
27903 return __Pyx_c_prod_double(
z, a);
27905 z = __Pyx_c_prod_double(a, a);
27906 return __Pyx_c_prod_double(
z,
z);
27912 }
else if (b.imag == 0) {
27913 z.real = pow(a.real, b.real);
27916 }
else if (a.real > 0) {
27921 theta = atan2(0, -1);
27924 r = __Pyx_c_abs_double(a);
27925 theta = atan2(a.imag, a.real);
27928 z_r = exp(lnr * b.real - theta * b.imag);
27929 z_theta = theta * b.real + lnr * b.imag;
27930 z.real = z_r * cos(z_theta);
27931 z.imag = z_r * sin(z_theta);
27938 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
27939 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
27940 const int is_unsigned = neg_one > const_zero;
27942 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
27943 return PyInt_FromLong((
long) value);
27944 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
27945 return PyLong_FromUnsignedLong((
unsigned long) value);
27946 #ifdef HAVE_LONG_LONG
27947 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
27948 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27952 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
27953 return PyInt_FromLong((
long) value);
27954 #ifdef HAVE_LONG_LONG
27955 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
27956 return PyLong_FromLongLong((PY_LONG_LONG) value);
27961 int one = 1;
int little = (int)*(
unsigned char *)&one;
27962 unsigned char *bytes = (
unsigned char *)&value;
27963 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
27964 little, !is_unsigned);
27969 static __Pyx_memviewslice
27970 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27971 const char *mode,
int ndim,
27972 size_t sizeof_dtype,
int contig_flag,
27973 int dtype_is_object)
27975 __Pyx_RefNannyDeclarations
27977 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27978 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27979 Py_buffer *buf = &from_memview->view;
27980 PyObject *shape_tuple = NULL;
27981 PyObject *temp_int = NULL;
27982 struct __pyx_array_obj *array_obj = NULL;
27983 struct __pyx_memoryview_obj *memview_obj = NULL;
27984 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27985 for (i = 0; i < ndim; i++) {
27986 if (from_mvs->suboffsets[i] >= 0) {
27987 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27988 "indirect dimensions (axis %d)", i);
27992 shape_tuple = PyTuple_New(ndim);
27993 if (unlikely(!shape_tuple)) {
27996 __Pyx_GOTREF(shape_tuple);
27997 for(i = 0; i < ndim; i++) {
27998 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27999 if(unlikely(!temp_int)) {
28002 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
28006 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
28007 if (unlikely(!array_obj)) {
28010 __Pyx_GOTREF(array_obj);
28011 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
28012 (PyObject *) array_obj, contig_flag,
28014 from_mvs->memview->typeinfo);
28015 if (unlikely(!memview_obj))
28017 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
28019 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
28020 dtype_is_object) < 0))
28024 __Pyx_XDECREF(new_mvs.memview);
28025 new_mvs.memview = NULL;
28026 new_mvs.data = NULL;
28028 __Pyx_XDECREF(shape_tuple);
28029 __Pyx_XDECREF(temp_int);
28030 __Pyx_XDECREF(array_obj);
28031 __Pyx_RefNannyFinishContext();
28036 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
28037 const int neg_one = (int) -1, const_zero = (
int) 0;
28038 const int is_unsigned = neg_one > const_zero;
28039 #if PY_MAJOR_VERSION < 3
28040 if (likely(PyInt_Check(x))) {
28041 if (
sizeof(
int) <
sizeof(long)) {
28042 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
28044 long val = PyInt_AS_LONG(x);
28045 if (is_unsigned && unlikely(val < 0)) {
28046 goto raise_neg_overflow;
28052 if (likely(PyLong_Check(x))) {
28054 #if CYTHON_USE_PYLONG_INTERNALS
28055 const digit* digits = ((PyLongObject*)x)->ob_digit;
28056 switch (Py_SIZE(x)) {
28057 case 0:
return (
int) 0;
28058 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
28060 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28061 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28062 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28063 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
28064 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28069 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28070 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28071 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28072 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
28073 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
28078 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28079 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28080 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28081 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
28082 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
28088 #if CYTHON_COMPILING_IN_CPYTHON
28089 if (unlikely(Py_SIZE(x) < 0)) {
28090 goto raise_neg_overflow;
28094 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28095 if (unlikely(result < 0))
28097 if (unlikely(result == 1))
28098 goto raise_neg_overflow;
28101 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28102 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
28103 #ifdef HAVE_LONG_LONG
28104 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28105 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28109 #if CYTHON_USE_PYLONG_INTERNALS
28110 const digit* digits = ((PyLongObject*)x)->ob_digit;
28111 switch (Py_SIZE(x)) {
28112 case 0:
return (
int) 0;
28113 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
28114 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
28116 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
28117 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28118 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28119 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28120 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28125 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
28126 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28127 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28128 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28129 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28134 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
28135 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28136 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28137 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28138 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28143 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
28144 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28145 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28146 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28147 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
28152 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
28153 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28154 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28155 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28156 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28161 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
28162 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28163 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28164 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
28165 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
28171 if (
sizeof(
int) <=
sizeof(long)) {
28172 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
28173 #ifdef HAVE_LONG_LONG
28174 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28175 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
28180 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28181 PyErr_SetString(PyExc_RuntimeError,
28182 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28185 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28186 #if PY_MAJOR_VERSION < 3
28187 if (likely(
v) && !PyLong_Check(
v)) {
28189 v = PyNumber_Long(tmp);
28194 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28195 unsigned char *bytes = (
unsigned char *)&val;
28196 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28197 bytes,
sizeof(val),
28198 is_little, !is_unsigned);
28208 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28209 if (!tmp)
return (
int) -1;
28210 val = __Pyx_PyInt_As_int(tmp);
28215 PyErr_SetString(PyExc_OverflowError,
28216 "value too large to convert to int");
28218 raise_neg_overflow:
28219 PyErr_SetString(PyExc_OverflowError,
28220 "can't convert negative value to int");
28225 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28226 const long neg_one = (long) -1, const_zero = (
long) 0;
28227 const int is_unsigned = neg_one > const_zero;
28228 #if PY_MAJOR_VERSION < 3
28229 if (likely(PyInt_Check(x))) {
28230 if (
sizeof(
long) <
sizeof(long)) {
28231 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28233 long val = PyInt_AS_LONG(x);
28234 if (is_unsigned && unlikely(val < 0)) {
28235 goto raise_neg_overflow;
28241 if (likely(PyLong_Check(x))) {
28243 #if CYTHON_USE_PYLONG_INTERNALS
28244 const digit* digits = ((PyLongObject*)x)->ob_digit;
28245 switch (Py_SIZE(x)) {
28246 case 0:
return (
long) 0;
28247 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28249 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28250 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28251 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28252 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28253 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28258 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28259 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28260 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28261 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28262 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28267 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28268 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28269 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28270 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28271 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28277 #if CYTHON_COMPILING_IN_CPYTHON
28278 if (unlikely(Py_SIZE(x) < 0)) {
28279 goto raise_neg_overflow;
28283 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28284 if (unlikely(result < 0))
28286 if (unlikely(result == 1))
28287 goto raise_neg_overflow;
28290 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28291 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28292 #ifdef HAVE_LONG_LONG
28293 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28294 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28298 #if CYTHON_USE_PYLONG_INTERNALS
28299 const digit* digits = ((PyLongObject*)x)->ob_digit;
28300 switch (Py_SIZE(x)) {
28301 case 0:
return (
long) 0;
28302 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28303 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28305 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28306 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28307 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28308 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28309 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28314 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28315 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28316 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28317 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28318 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28323 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28324 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28325 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28326 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28327 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28332 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28333 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28334 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28335 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28336 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28341 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28342 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28343 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28344 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28345 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28350 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28351 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28352 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28353 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28354 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28360 if (
sizeof(
long) <=
sizeof(long)) {
28361 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28362 #ifdef HAVE_LONG_LONG
28363 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28364 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28369 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28370 PyErr_SetString(PyExc_RuntimeError,
28371 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28374 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28375 #if PY_MAJOR_VERSION < 3
28376 if (likely(
v) && !PyLong_Check(
v)) {
28378 v = PyNumber_Long(tmp);
28383 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28384 unsigned char *bytes = (
unsigned char *)&val;
28385 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28386 bytes,
sizeof(val),
28387 is_little, !is_unsigned);
28397 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28398 if (!tmp)
return (
long) -1;
28399 val = __Pyx_PyInt_As_long(tmp);
28404 PyErr_SetString(PyExc_OverflowError,
28405 "value too large to convert to long");
28407 raise_neg_overflow:
28408 PyErr_SetString(PyExc_OverflowError,
28409 "can't convert negative value to long");
28414 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28415 const char neg_one = (char) -1, const_zero = (
char) 0;
28416 const int is_unsigned = neg_one > const_zero;
28417 #if PY_MAJOR_VERSION < 3
28418 if (likely(PyInt_Check(x))) {
28419 if (
sizeof(
char) <
sizeof(long)) {
28420 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28422 long val = PyInt_AS_LONG(x);
28423 if (is_unsigned && unlikely(val < 0)) {
28424 goto raise_neg_overflow;
28430 if (likely(PyLong_Check(x))) {
28432 #if CYTHON_USE_PYLONG_INTERNALS
28433 const digit* digits = ((PyLongObject*)x)->ob_digit;
28434 switch (Py_SIZE(x)) {
28435 case 0:
return (
char) 0;
28436 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28438 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28439 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28440 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28441 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28442 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28447 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28448 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28449 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28450 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28451 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28456 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28457 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28458 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28459 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28460 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28466 #if CYTHON_COMPILING_IN_CPYTHON
28467 if (unlikely(Py_SIZE(x) < 0)) {
28468 goto raise_neg_overflow;
28472 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28473 if (unlikely(result < 0))
28475 if (unlikely(result == 1))
28476 goto raise_neg_overflow;
28479 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28480 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28481 #ifdef HAVE_LONG_LONG
28482 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28483 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28487 #if CYTHON_USE_PYLONG_INTERNALS
28488 const digit* digits = ((PyLongObject*)x)->ob_digit;
28489 switch (Py_SIZE(x)) {
28490 case 0:
return (
char) 0;
28491 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28492 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28494 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28495 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28496 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28497 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28498 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28503 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28504 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28505 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28506 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28507 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28512 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28513 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28514 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28515 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28516 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28521 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28522 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28523 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28524 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28525 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28530 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28531 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28532 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28533 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28534 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28539 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28540 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28541 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28542 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28543 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28549 if (
sizeof(
char) <=
sizeof(long)) {
28550 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28551 #ifdef HAVE_LONG_LONG
28552 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28553 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28558 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28559 PyErr_SetString(PyExc_RuntimeError,
28560 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28563 PyObject *
v = __Pyx_PyNumber_IntOrLong(x);
28564 #if PY_MAJOR_VERSION < 3
28565 if (likely(
v) && !PyLong_Check(
v)) {
28567 v = PyNumber_Long(tmp);
28572 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28573 unsigned char *bytes = (
unsigned char *)&val;
28574 int ret = _PyLong_AsByteArray((PyLongObject *)
v,
28575 bytes,
sizeof(val),
28576 is_little, !is_unsigned);
28586 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28587 if (!tmp)
return (
char) -1;
28588 val = __Pyx_PyInt_As_char(tmp);
28593 PyErr_SetString(PyExc_OverflowError,
28594 "value too large to convert to char");
28596 raise_neg_overflow:
28597 PyErr_SetString(PyExc_OverflowError,
28598 "can't convert negative value to char");
28603 static int __Pyx_check_binary_version(
void) {
28604 char ctversion[4], rtversion[4];
28605 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28606 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28607 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28609 PyOS_snprintf(message,
sizeof(message),
28610 "compiletime version %s of module '%.100s' "
28611 "does not match runtime version %s",
28612 ctversion, __Pyx_MODULE_NAME, rtversion);
28613 return PyErr_WarnEx(NULL, message, 1);
28619 #ifndef __PYX_HAVE_RT_ImportModule
28620 #define __PYX_HAVE_RT_ImportModule
28621 static PyObject *__Pyx_ImportModule(
const char *name) {
28622 PyObject *py_name = 0;
28623 PyObject *py_module = 0;
28624 py_name = __Pyx_PyIdentifier_FromString(name);
28627 py_module = PyImport_Import(py_name);
28628 Py_DECREF(py_name);
28631 Py_XDECREF(py_name);
28637 #ifndef __PYX_HAVE_RT_ImportType
28638 #define __PYX_HAVE_RT_ImportType
28639 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
28640 size_t size,
int strict)
28642 PyObject *py_module = 0;
28643 PyObject *result = 0;
28644 PyObject *py_name = 0;
28646 Py_ssize_t basicsize;
28647 #ifdef Py_LIMITED_API
28648 PyObject *py_basicsize;
28650 py_module = __Pyx_ImportModule(module_name);
28653 py_name = __Pyx_PyIdentifier_FromString(class_name);
28656 result = PyObject_GetAttr(py_module, py_name);
28657 Py_DECREF(py_name);
28659 Py_DECREF(py_module);
28663 if (!PyType_Check(result)) {
28664 PyErr_Format(PyExc_TypeError,
28665 "%.200s.%.200s is not a type object",
28666 module_name, class_name);
28669 #ifndef Py_LIMITED_API
28670 basicsize = ((PyTypeObject *)result)->tp_basicsize;
28672 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
28675 basicsize = PyLong_AsSsize_t(py_basicsize);
28676 Py_DECREF(py_basicsize);
28678 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28681 if (!strict && (
size_t)basicsize > size) {
28682 PyOS_snprintf(warning,
sizeof(warning),
28683 "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28684 module_name, class_name, basicsize, size);
28685 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
28687 else if ((
size_t)basicsize != size) {
28688 PyErr_Format(PyExc_ValueError,
28689 "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28690 module_name, class_name, basicsize, size);
28693 return (PyTypeObject *)result;
28695 Py_XDECREF(py_module);
28696 Py_XDECREF(result);
28702 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28704 #if PY_MAJOR_VERSION < 3
28705 if (t->is_unicode) {
28706 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28707 }
else if (t->intern) {
28708 *t->p = PyString_InternFromString(t->s);
28710 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28713 if (t->is_unicode | t->is_str) {
28715 *t->p = PyUnicode_InternFromString(t->s);
28716 }
else if (t->encoding) {
28717 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28719 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28722 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28727 if (PyObject_Hash(*t->p) == -1)
28734 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28735 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28737 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28739 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28741 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28742 #if !CYTHON_PEP393_ENABLED
28743 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28745 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28746 if (!defenc)
return NULL;
28747 defenc_c = PyBytes_AS_STRING(defenc);
28748 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28750 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28752 for (
c = defenc_c;
c < end;
c++) {
28753 if ((
unsigned char) (*
c) >= 128) {
28754 PyUnicode_AsASCIIString(o);
28760 *length = PyBytes_GET_SIZE(defenc);
28764 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28765 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28766 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28767 if (likely(PyUnicode_IS_ASCII(o))) {
28768 *length = PyUnicode_GET_LENGTH(o);
28769 return PyUnicode_AsUTF8(o);
28771 PyUnicode_AsASCIIString(o);
28775 return PyUnicode_AsUTF8AndSize(o, length);
28780 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28781 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28783 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28784 __Pyx_sys_getdefaultencoding_not_ascii &&
28786 PyUnicode_Check(o)) {
28787 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28790 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28791 if (PyByteArray_Check(o)) {
28792 *length = PyByteArray_GET_SIZE(o);
28793 return PyByteArray_AS_STRING(o);
28798 int r = PyBytes_AsStringAndSize(o, &result, length);
28799 if (unlikely(
r < 0)) {
28806 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28807 int is_true = x == Py_True;
28808 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28809 else return PyObject_IsTrue(x);
28811 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28812 #if PY_MAJOR_VERSION >= 3
28813 if (PyLong_Check(result)) {
28814 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28815 "__int__ returned non-int (type %.200s). "
28816 "The ability to return an instance of a strict subclass of int "
28817 "is deprecated, and may be removed in a future version of Python.",
28818 Py_TYPE(result)->tp_name)) {
28825 PyErr_Format(PyExc_TypeError,
28826 "__%.4s__ returned non-%.4s (type %.200s)",
28827 type_name, type_name, Py_TYPE(result)->tp_name);
28831 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28832 #if CYTHON_USE_TYPE_SLOTS
28833 PyNumberMethods *m;
28835 const char *name = NULL;
28836 PyObject *res = NULL;
28837 #if PY_MAJOR_VERSION < 3
28838 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28840 if (likely(PyLong_Check(x)))
28842 return __Pyx_NewRef(x);
28843 #if CYTHON_USE_TYPE_SLOTS
28844 m = Py_TYPE(x)->tp_as_number;
28845 #if PY_MAJOR_VERSION < 3
28846 if (m && m->nb_int) {
28848 res = m->nb_int(x);
28850 else if (m && m->nb_long) {
28852 res = m->nb_long(x);
28855 if (likely(m && m->nb_int)) {
28857 res = m->nb_int(x);
28861 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28862 res = PyNumber_Int(x);
28866 #if PY_MAJOR_VERSION < 3
28867 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28869 if (unlikely(!PyLong_CheckExact(res))) {
28871 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28874 else if (!PyErr_Occurred()) {
28875 PyErr_SetString(PyExc_TypeError,
28876 "an integer is required");
28880 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28883 #if PY_MAJOR_VERSION < 3
28884 if (likely(PyInt_CheckExact(b))) {
28885 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28886 return PyInt_AS_LONG(b);
28888 return PyInt_AsSsize_t(x);
28891 if (likely(PyLong_CheckExact(b))) {
28892 #if CYTHON_USE_PYLONG_INTERNALS
28893 const digit* digits = ((PyLongObject*)b)->ob_digit;
28894 const Py_ssize_t size = Py_SIZE(b);
28895 if (likely(__Pyx_sst_abs(size) <= 1)) {
28896 ival = likely(size) ? digits[0] : 0;
28897 if (size == -1) ival = -ival;
28902 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28903 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28907 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28908 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28912 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28913 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28917 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28918 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28922 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28923 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28927 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28928 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28934 return PyLong_AsSsize_t(b);
28936 x = PyNumber_Index(b);
28938 ival = PyInt_AsSsize_t(x);
28942 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28943 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28945 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28946 return PyInt_FromSize_t(ival);